Alias sh' as
` condition keyword
This commit is contained in:
parent
475b019dd7
commit
6f563803df
@ -28,3 +28,31 @@ Feature: `` condition keyword
|
|||||||
"""
|
"""
|
||||||
When I successfully execute the recipe
|
When I successfully execute the recipe
|
||||||
Then the output must not contain "evaluated"
|
Then the output must not contain "evaluated"
|
||||||
|
|
||||||
|
Scenario: `sh' alias, succeeds when remote executable is available
|
||||||
|
Given a recipe with:
|
||||||
|
"""
|
||||||
|
target 'some_host.test'
|
||||||
|
|
||||||
|
task :testing_remote_command do
|
||||||
|
condition { sh 'false' }
|
||||||
|
|
||||||
|
echo 'evaluated'
|
||||||
|
end
|
||||||
|
"""
|
||||||
|
When I successfully execute the recipe
|
||||||
|
Then the output must not contain "evaluated"
|
||||||
|
|
||||||
|
Scenario: succeeds when remote executable is available
|
||||||
|
Given a recipe with:
|
||||||
|
"""
|
||||||
|
target 'some_host.test'
|
||||||
|
|
||||||
|
task :testing_remote_command do
|
||||||
|
condition { sh 'false' }
|
||||||
|
|
||||||
|
echo 'evaluated'
|
||||||
|
end
|
||||||
|
"""
|
||||||
|
When I successfully execute the recipe
|
||||||
|
Then the output must not contain "evaluated"
|
||||||
|
@ -14,6 +14,7 @@ module Producer
|
|||||||
end
|
end
|
||||||
|
|
||||||
define_test :`, Tests::ShellCommandStatus
|
define_test :`, Tests::ShellCommandStatus
|
||||||
|
define_test :sh, Tests::ShellCommandStatus
|
||||||
define_test :file_contains, Tests::FileContains
|
define_test :file_contains, Tests::FileContains
|
||||||
define_test :has_env, Tests::HasEnv
|
define_test :has_env, Tests::HasEnv
|
||||||
define_test :has_executable, Tests::HasExecutable
|
define_test :has_executable, Tests::HasExecutable
|
||||||
|
@ -9,6 +9,7 @@ module Producer::Core
|
|||||||
|
|
||||||
%w[
|
%w[
|
||||||
`
|
`
|
||||||
|
sh
|
||||||
file_contains
|
file_contains
|
||||||
has_dir
|
has_dir
|
||||||
has_env
|
has_env
|
||||||
|
Loading…
x
Reference in New Issue
Block a user