describe 'something' do
context 'with my context' do
around { |ex| MyService.with_context('A stub context') { ex.run } }
it { is_expected.to eq something }
end
end
Option 1
# type: :rester or some other tag could add the `rester_context` method.
describe 'something', type: :rester do
context 'with my context' do
rester_context MyService, 'A stub context'
it { is_expected.to eq something }
end
end
Option 2
describe 'something' do
# Could make stub contexts case-insensitive.
context 'a stub context', service: MyService do
it { is_expected.to eq something }
end
end
Option 3
describe 'something' do
# This one might be kind of tricky to implement with rspec.
context 'with my context', MyService: 'A stub context' do
it { is_expected.to eq something }
end
end
Currently we set contexts like so:
Option 1
Option 2
Option 3