producer-core/features/steps/recipe_steps.rb
Thibault Jouan 1ccd95b80f Fix error formatting in debug mode
Backtrace filtering was only disabled for exception cause, this change
ensure no backtrace filtering at all in debug mode.

* Prevent main exception filtering when debug mode is enabled;
* Test when exception cause must be displayed;
* Test how exception cause must be displayed.
2015-04-03 23:18:28 +00:00

57 lines
1.6 KiB
Ruby

Given /^a recipe with:$/ do |recipe_body|
write_file 'recipe.rb', recipe_body
end
Given /^a recipe with an error$/ do
write_file 'recipe.rb', "task(:trigger_error) { fail 'some error' }\n"
end
Given /^a recipe using a remote$/ do
write_file 'recipe.rb', "task(:some_task) { sh 'echo hello' }\n"
end
Given /^a recipe named "([^"]+)" with:$/ do |recipe_path, recipe_body|
write_file recipe_path, recipe_body
end
When /^I execute the recipe$/ do
run_simple 'producer recipe.rb', false
end
When /^I execute the recipe on remote target$/ do
run_simple 'producer recipe.rb -t some_host.test', false
end
When /^I execute the recipe on unknown remote target$/ do
run_simple 'producer recipe.rb -t #unknown_host.test', false
assert_matching_output '\ASocketError', all_output
end
When /^I execute the recipe on unknown remote target with option (-.+)$/ do |option|
run_simple "producer recipe.rb #{option} -t #unknown_host.test", false
assert_matching_output '\ASocketError', all_output
end
When /^I successfully execute the recipe$/ do
step 'I execute the recipe'
assert_exit_status 0
end
When /^I successfully execute the recipe on remote target$/ do
step 'I execute the recipe on remote target'
assert_exit_status 0
end
When /^I execute the recipe with option (-.+)$/ do |option|
run_simple "producer #{option} recipe.rb", false
end
When /^I successfully execute the recipe with option (-.+)$/ do |option|
run_simple "producer #{option} recipe.rb", false
assert_exit_status 0
end
When /^I execute the recipe interactively$/ do
run_interactive 'producer recipe.rb'
end