Improve recipe spec:
* Use explicit named subject for Recipe::DSL; * Fix Recipe::DSL#source example description.
This commit is contained in:
parent
ead09c2118
commit
080ef063c0
@ -36,7 +36,7 @@ module Producer::Core
|
|||||||
|
|
||||||
|
|
||||||
describe Recipe::DSL do
|
describe Recipe::DSL do
|
||||||
let(:dsl) { Recipe::DSL.new &code }
|
subject(:dsl) { Recipe::DSL.new &code }
|
||||||
|
|
||||||
describe '#initialize' do
|
describe '#initialize' do
|
||||||
let(:code) { Proc.new { raise 'error from recipe' } }
|
let(:code) { Proc.new { raise 'error from recipe' } }
|
||||||
@ -47,10 +47,10 @@ module Producer::Core
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe '#source' do
|
describe '#source' do
|
||||||
let(:code) { "source '#{fixture_path_for 'recipes/error'}'" }
|
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')
|
expect { dsl }.to raise_error(RuntimeError, 'error from recipe')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user