Implement Task::DSL#evaluate:

So that the env is available from the task DSL.
This commit is contained in:
Thibault Jouan
2013-07-30 23:24:28 +00:00
parent a45a340b64
commit ace6a4ad2b
6 changed files with 28 additions and 12 deletions

View File

@@ -13,9 +13,18 @@ module Producer::Core
end
describe '#evaluate' do
let(:env) { double('env') }
it 'builds a task DSL sandbox' do
expect(Task::DSL).to receive(:new).with(&block)
task.evaluate
expect(Task::DSL).to receive(:new).with(&block).and_call_original
task.evaluate(env)
end
it 'evaluates the task DSL sandbox' do
dsl = double('task dsl')
allow(Task::DSL).to receive(:new) { dsl }
expect(dsl).to receive(:evaluate).with(env)
task.evaluate(env)
end
end
end