Refactor and fix features

This commit is contained in:
Thibault Jouan
2014-05-29 14:31:13 +00:00
parent 237e6db740
commit 2fecb4bde4
18 changed files with 126 additions and 178 deletions

View File

@@ -1,58 +1,48 @@
@sshd
Feature: `env?' condition keyword
Scenario: succeeds when remote environment variable is defined
Background:
Given a recipe with:
"""
target 'some_host.test'
task :testing_env_var_definition do
task :env_test_definition_ok do
condition { env? :shell }
echo 'evaluated'
echo 'definition_ok'
end
"""
When I successfully execute the recipe
Then the output must contain "evaluated"
Scenario: fails when remote environment variable is not defined
Given a recipe with:
"""
target 'some_host.test'
task :testing_env_var_definition do
task :env_test_definition_ko do
condition { env? :non_existent_var }
echo 'evaluated'
echo 'definition_ko'
end
"""
When I successfully execute the recipe
Then the output must not contain "evaluated"
Scenario: succeeds when remote environment variable value match
Given a recipe with:
"""
target 'some_host.test'
task :testing_env_var_value do
task :env_test_value do
condition { env? :shell, '/bin/sh' }
echo 'evaluated'
echo 'value_ok'
end
"""
When I successfully execute the recipe
Then the output must contain "evaluated"
Scenario: fails when remote environment variable value does not match
Given a recipe with:
"""
target 'some_host.test'
task :testing_env_var_value do
task :env_test_value do
condition { env? :shell, 'non_existent_shell' }
echo 'evaluated'
echo 'value_ko'
end
"""
Scenario: succeeds when remote environment variable is defined
When I successfully execute the recipe
Then the output must not contain "evaluated"
Then the output must contain "definition_ok"
Scenario: fails when remote environment variable is not defined
When I successfully execute the recipe
Then the output must not contain "definition_ko"
Scenario: succeeds when remote environment variable value match
When I successfully execute the recipe
Then the output must contain "value_ok"
Scenario: fails when remote environment variable value does not match
When I successfully execute the recipe
Then the output must not contain "value_ko"