Flatten features directory tree

This commit is contained in:
Thibault Jouan
2014-05-29 14:20:02 +00:00
parent d4d1657a4a
commit bff6b85e8e
26 changed files with 0 additions and 0 deletions

View File

@@ -1,23 +0,0 @@
@sshd
Feature: `dir?' condition keyword
Background:
Given a recipe with:
"""
target 'some_host.test'
task :testing_directory_existence do
condition { dir? 'some_directory' }
echo 'evaluated'
end
"""
Scenario: succeeds when directory exists
Given a remote directory named "some_directory"
When I successfully execute the recipe
Then the output must contain "evaluated"
Scenario: fails when directory does not exist
When I successfully execute the recipe
Then the output must not contain "evaluated"

View File

@@ -1,58 +0,0 @@
@sshd
Feature: `env?' condition keyword
Scenario: succeeds when remote environment variable is defined
Given a recipe with:
"""
target 'some_host.test'
task :testing_env_var_definition do
condition { env? :shell }
echo 'evaluated'
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
condition { env? :non_existent_var }
echo 'evaluated'
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
condition { env? :shell, '/bin/sh' }
echo 'evaluated'
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
condition { env? :shell, 'non_existent_shell' }
echo 'evaluated'
end
"""
When I successfully execute the recipe
Then the output must not contain "evaluated"

View File

@@ -1,30 +0,0 @@
@sshd
Feature: `executable?' condition keyword
Scenario: succeeds when remote executable is available
Given a recipe with:
"""
target 'some_host.test'
task :testing_executable_availability do
condition { executable? 'true' }
echo 'evaluated'
end
"""
When I successfully execute the recipe
Then the output must contain "evaluated"
Scenario: succeeds when remote executable is available
Given a recipe with:
"""
target 'some_host.test'
task :testing_executable_availability do
condition { executable? 'some_non_existent_executable' }
echo 'evaluated'
end
"""
When I successfully execute the recipe
Then the output must not contain "evaluated"

View File

@@ -1,23 +0,0 @@
@sshd
Feature: `file?' condition keyword
Background:
Given a recipe with:
"""
target 'some_host.test'
task :testing_file_existence do
condition { file? 'some_file' }
echo 'evaluated'
end
"""
Scenario: succeeds when file exists
Given a remote file named "some_file"
When I successfully execute the recipe
Then the output must contain "evaluated"
Scenario: fails when file does not exist
When I successfully execute the recipe
Then the output must not contain "evaluated"

View File

@@ -1,28 +0,0 @@
@sshd
Feature: `file_contains' condition keyword
Background:
Given a recipe with:
"""
target 'some_host.test'
task :testing_content_in_file_presense do
condition { file_contains 'some_file', 'some_content' }
echo 'evaluated'
end
"""
Scenario: succeeds when file contains expected content
Given a remote file named "some_file" with "some_content"
When I successfully execute the recipe
Then the output must contain "evaluated"
Scenario: fails when file does not contain expected content
Given a remote file named "some_file" with "some_other_content"
When I successfully execute the recipe
Then the output must not contain "evaluated"
Scenario: fails when file does not exist
When I successfully execute the recipe
Then the output must not contain "evaluated"

View File

@@ -1,44 +0,0 @@
@sshd
Feature: negated test prefix (no_)
Scenario: prefixed test fails when non-prefixed test is successful
Given a recipe with:
"""
target 'some_host.test'
task :successful_test do
condition { env? :shell }
echo 'successful_test'
end
task :negated_test do
condition { no_env? :shell }
echo 'negated_test'
end
"""
When I successfully execute the recipe
Then the output must contain "successful_test"
And the output must not contain "negated_test"
Scenario: prefixed test fails when non-prefixed test is failing
Given a recipe with:
"""
target 'some_host.test'
task :failing_test do
condition { env? :inexistent_var }
echo 'failing_test'
end
task :negated_test do
condition { no_env? :inexistent_var }
echo 'negated_test'
end
"""
When I successfully execute the recipe
Then the output must not contain "failing_test"
And the output must contain "negated_test"

View File

@@ -1,58 +0,0 @@
@sshd
Feature: `` condition keyword
Scenario: succeeds when remote command execution is a success
Given a recipe with:
"""
target 'some_host.test'
task :testing_remote_command do
condition { `true` }
echo 'evaluated'
end
"""
When I successfully execute the recipe
Then the output must contain "evaluated"
Scenario: succeeds when remote executable is available
Given a recipe with:
"""
target 'some_host.test'
task :testing_remote_command do
condition { `false` }
echo 'evaluated'
end
"""
When I successfully execute the recipe
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"