Improve some context descriptions in specs
This commit is contained in:
parent
0aa043b61a
commit
a45a340b64
@ -77,7 +77,7 @@ module Producer::Core
|
||||
cli.evaluate_recipe_file
|
||||
end
|
||||
|
||||
context 'error during recipe evaluation' do
|
||||
context 'when recipe evaluation fails' do
|
||||
let(:recipe_file) { fixture_path_for('recipes/invalid.rb') }
|
||||
let(:stdout) { StringIO.new }
|
||||
subject(:cli) { CLI.new(arguments, stdout) }
|
||||
|
@ -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}/
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ module Producer::Core
|
||||
end
|
||||
|
||||
describe '#condition' do
|
||||
context 'condition is met (block evals to true)' do
|
||||
context 'when met (block evals to true)' do
|
||||
let(:block) { Proc.new {
|
||||
condition { true }
|
||||
raise 'error after condition'
|
||||
@ -24,7 +24,7 @@ module Producer::Core
|
||||
end
|
||||
end
|
||||
|
||||
context 'condition is not met (block evals to false)' do
|
||||
context 'when not met (block evals to false)' do
|
||||
let(:block) { Proc.new {
|
||||
condition { false }
|
||||
raise
|
||||
|
Loading…
x
Reference in New Issue
Block a user