Improve small details in specs:
* Fix coding standards; * Simplify some expectations (eq instead of be matcher); * Expect identity on block instead of calling; * Change some before call as oneliners; * Avoid shadowing variable names; * Improve wording where needed.
This commit is contained in:
@@ -12,24 +12,22 @@ module Producer::Core
|
||||
end
|
||||
|
||||
describe '#process_task' do
|
||||
let(:action) { double('action') }
|
||||
let(:action) { double 'action' }
|
||||
let(:task) { double('task', actions: [action]).as_null_object }
|
||||
|
||||
context 'when task condition is met' do
|
||||
it 'applies the actions' do
|
||||
expect(action).to receive(:apply)
|
||||
interpreter.process_task(task)
|
||||
expect(action).to receive :apply
|
||||
interpreter.process_task task
|
||||
end
|
||||
end
|
||||
|
||||
context 'when task condition is not met' do
|
||||
before do
|
||||
allow(task).to receive(:condition_met?) { false }
|
||||
end
|
||||
before { allow(task).to receive(:condition_met?) { false } }
|
||||
|
||||
it 'does not apply the actions' do
|
||||
expect(action).not_to receive(:apply)
|
||||
interpreter.process_task(task)
|
||||
expect(action).not_to receive :apply
|
||||
interpreter.process_task task
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user