Implement basic task actions API:
* Add Action base class; * Implement Task::DSL.define_action(keyword, klass); * Add Task::DSL#actions accessor; * Apply task DSL actions when Task instances are evaluated.
This commit is contained in:
@@ -21,11 +21,20 @@ module Producer::Core
|
||||
end
|
||||
|
||||
it 'evaluates the task DSL sandbox' do
|
||||
dsl = double('task dsl')
|
||||
dsl = double('task DSL').as_null_object
|
||||
allow(Task::DSL).to receive(:new) { dsl }
|
||||
expect(dsl).to receive(:evaluate).with(env)
|
||||
task.evaluate(env)
|
||||
end
|
||||
|
||||
it 'applies DSL sandbox actions' do
|
||||
dsl = double('task DSL').as_null_object
|
||||
allow(Task::DSL).to receive(:new) { dsl }
|
||||
action = double('action')
|
||||
allow(dsl).to receive(:actions) { [action] }
|
||||
expect(action).to receive(:apply)
|
||||
task.evaluate(env)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user