Improve recipe spec:

* Use explicit named subject for Recipe::DSL;
* Fix Recipe::DSL#source example description.
This commit is contained in:
Thibault Jouan 2013-07-29 13:28:21 +00:00
parent ead09c2118
commit 080ef063c0

View File

@ -36,7 +36,7 @@ module Producer::Core
describe Recipe::DSL do
let(:dsl) { Recipe::DSL.new &code }
subject(:dsl) { Recipe::DSL.new &code }
describe '#initialize' do
let(:code) { Proc.new { raise 'error from recipe' } }
@ -48,9 +48,9 @@ module Producer::Core
describe '#source' do
let(:code) { "source '#{fixture_path_for 'recipes/error'}'" }
let(:dsl) { Recipe::DSL.new code }
subject(:dsl) { Recipe::DSL.new code }
it 'evaluates its code' do
it 'sources the recipe given as argument' do
expect { dsl }.to raise_error(RuntimeError, 'error from recipe')
end
end