From 29563f6cc696b1ef32f565925992c85497cca567 Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Tue, 6 Aug 2013 20:30:24 +0000 Subject: [PATCH] Add missing spec for Recipe::DSL#task --- spec/producer/core/recipe/dsl_spec.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/producer/core/recipe/dsl_spec.rb b/spec/producer/core/recipe/dsl_spec.rb index 0193030..c53059f 100644 --- a/spec/producer/core/recipe/dsl_spec.rb +++ b/spec/producer/core/recipe/dsl_spec.rb @@ -109,7 +109,12 @@ module Producer::Core end describe '#task' do - let(:code) { proc { task(:first); task(:last) } } + let(:code) { proc { task(:first) { throw :first_task }; task(:last) } } + + it 'register a task with its code' do + expect(dsl.tasks.first.name).to eq :first + expect { dsl.tasks.first.evaluate(env) }.to throw_symbol :first_task + end it 'registers tasks in declaration order' do expect(dsl.tasks[0].name).to eq :first