Improve some context descriptions in specs

This commit is contained in:
Thibault Jouan committed 2013-08-01 00:01:20 +00:00
1 parent 0aa043b61a
commit a45a340b64
3 files changed
+6 -6

No files matched your search

+3 -3
View File
@@ -36,7 +36,7 @@ module Producer::Core
expect(dsl.evaluate(env)).to eq dsl
end
context 'invalid recipe' do
context 'when recipe is invalid' do
let(:filepath) { fixture_path_for 'recipes/error.rb' }
let(:recipe) { Recipe.from_file(filepath) }
subject(:dsl) { Recipe::DSL.new File.read(filepath) }
@@ -67,8 +67,8 @@ module Producer::Core
expect { dsl.evaluate(env) }.to raise_error(RuntimeError, 'error from recipe')
end
context 'invalid sourced recipe' do
it 'reports the sourced recipe file path in the error' do
context 'when sourced recipe is invalid' do
it 'reports its file path in the error' do
expect { dsl.evaluate(env) }.to raise_error(RuntimeError) { |e|
expect(e.backtrace.first).to match /\A#{filepath}/
}