Improve some context descriptions in specs

This commit is contained in:
Thibault Jouan
2013-07-31 22:45:42 +00:00
parent 0aa043b61a
commit a45a340b64
3 changed files with 6 additions and 6 deletions

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}/
}