Refactor producer invocation in cucumber features:
Use "When I successfully execute" instead of "When I execute", and assert that exit status code was successful in this new step.
This commit is contained in:
parent
0a9f7e38af
commit
33a2b9de5a
@ -7,6 +7,5 @@ Feature: `echo' task action
|
||||
echo 'hello'
|
||||
end
|
||||
"""
|
||||
When I execute the recipe
|
||||
Then the exit status must be 0
|
||||
When I successfully execute the recipe
|
||||
And the output must contain exactly "hello\n"
|
||||
|
@ -22,7 +22,7 @@ Feature: sh task action
|
||||
sh '\echo from remote'
|
||||
end
|
||||
"""
|
||||
When I execute the recipe
|
||||
When I successfully execute the recipe
|
||||
Then the output must contain "from remote"
|
||||
|
||||
Scenario: aborts on failed command execution
|
||||
|
@ -5,6 +5,5 @@ Feature: recipe evaluation
|
||||
"""
|
||||
puts 'hello from recipe'
|
||||
"""
|
||||
When I execute the recipe
|
||||
Then the exit status must be 0
|
||||
When I successfully execute the recipe
|
||||
And the output must contain exactly "hello from recipe\n"
|
||||
|
@ -11,6 +11,5 @@ Feature: `source' recipe keyword
|
||||
"""
|
||||
puts 'sourced recipe'
|
||||
"""
|
||||
When I execute the recipe
|
||||
Then the exit status must be 0
|
||||
When I successfully execute the recipe
|
||||
And the output must contain "sourced recipe"
|
||||
|
@ -7,6 +7,5 @@ Feature: `target' recipe keyword
|
||||
|
||||
puts env.target
|
||||
"""
|
||||
When I execute the recipe
|
||||
Then the exit status must be 0
|
||||
When I successfully execute the recipe
|
||||
And the output must contain exactly "some_host.example\n"
|
||||
|
@ -5,3 +5,8 @@ end
|
||||
When(/^I execute the recipe$/) do
|
||||
run_simple('producer recipe.rb', false)
|
||||
end
|
||||
|
||||
When(/^I successfully execute the recipe$/) do
|
||||
step 'I execute the recipe'
|
||||
assert_exit_status(0)
|
||||
end
|
||||
|
@ -9,6 +9,5 @@ Feature: `condition' task keyword
|
||||
echo 'evaluated'
|
||||
end
|
||||
"""
|
||||
When I execute the recipe
|
||||
Then the exit status must be 0
|
||||
When I successfully execute the recipe
|
||||
And the output must not contain "evaluated"
|
||||
|
@ -7,6 +7,5 @@ Feature: task evaluation
|
||||
puts 'hello from recipe'
|
||||
end
|
||||
"""
|
||||
When I execute the recipe
|
||||
Then the exit status must be 0
|
||||
When I successfully execute the recipe
|
||||
And the output must contain exactly "hello from recipe\n"
|
||||
|
@ -12,8 +12,7 @@ Feature: `has_env' condition keyword
|
||||
echo 'evaluated'
|
||||
end
|
||||
"""
|
||||
When I execute the recipe
|
||||
Then the exit status must be 0
|
||||
When I successfully execute the recipe
|
||||
And the output must contain "evaluated"
|
||||
|
||||
Scenario: fails when remote environment variable is not defined
|
||||
@ -27,6 +26,5 @@ Feature: `has_env' condition keyword
|
||||
echo 'evaluated'
|
||||
end
|
||||
"""
|
||||
When I execute the recipe
|
||||
Then the exit status must be 0
|
||||
When I successfully execute the recipe
|
||||
And the output must not contain "evaluated"
|
||||
|
Loading…
x
Reference in New Issue
Block a user