Simplify Task::DSL.evaluate spec

This commit is contained in:
Thibault Jouan 2013-08-22 10:45:12 +00:00
parent 782c8f8498
commit 0a9f7e38af

View File

@ -28,10 +28,10 @@ module Producer::Core
end
it 'builds a task with its name, actions and condition' do
dsl = double('dsl').as_null_object
dsl = double(
'dsl', actions: [:some_action], condition: :some_condition
).as_null_object
allow(Task::DSL).to receive(:new) { dsl }
allow(dsl).to receive(:actions) { [:some_action] }
allow(dsl).to receive(:condition) { :some_condition }
expect(Task)
.to receive(:new).with(:some_task, [:some_action], :some_condition)
Task::DSL.evaluate(name, env, &block)