Refactor features

This commit is contained in:
Thibault Jouan
2014-07-18 12:23:17 +00:00
parent 959ffca4e9
commit a033e19583
15 changed files with 40 additions and 63 deletions

View File

@@ -4,36 +4,30 @@ Feature: `sh' task action
Scenario: forwards standard ouput
Given a recipe with:
"""
target 'some_host.test'
task :sh_action do
sh '\echo hello from remote'
end
"""
When I successfully execute the recipe
When I successfully execute the recipe on remote target
Then the output must contain exactly "hello from remote\n"
Scenario: aborts on failed command execution
Given a recipe with:
"""
target 'some_host.test'
task :sh_action_aborting do
sh '\false'
sh '\echo after_fail'
end
"""
When I execute the recipe
When I execute the recipe on remote target
Then the output must not contain "after_fail"
Scenario: prints command when execution fail
Given a recipe with:
"""
target 'some_host.test'
task :sh_action_command_error do
sh '\false'
end
"""
When I execute the recipe
When I execute the recipe on remote target
Then the output must match /\A\w+Error:\s+\\false/