Unflatten features directory tree
This commit is contained in:
47
features/condition/negated_test.feature
Normal file
47
features/condition/negated_test.feature
Normal file
@@ -0,0 +1,47 @@
|
||||
Feature: negated test prefix (no_)
|
||||
|
||||
Scenario: prefixed test fails when non-prefixed test is successful
|
||||
Given a recipe with:
|
||||
"""
|
||||
test_macro :even? do |n|
|
||||
n % 2 == 0
|
||||
end
|
||||
|
||||
task :successful_test do
|
||||
condition { even? 4 }
|
||||
|
||||
echo 'successful_test'
|
||||
end
|
||||
|
||||
task :negated_test do
|
||||
condition { no_even? 4 }
|
||||
|
||||
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 succeed when non-prefixed test is failing
|
||||
Given a recipe with:
|
||||
"""
|
||||
test_macro :even? do |n|
|
||||
n % 2 == 0
|
||||
end
|
||||
|
||||
task :failing_test do
|
||||
condition { even? 5 }
|
||||
|
||||
echo 'failing_test'
|
||||
end
|
||||
|
||||
task :negated_test do
|
||||
condition { no_even? 5 }
|
||||
|
||||
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"
|
15
features/condition/target.feature
Normal file
15
features/condition/target.feature
Normal file
@@ -0,0 +1,15 @@
|
||||
Feature: `target' condition keyword
|
||||
|
||||
Scenario: returns the current target
|
||||
Given a recipe with:
|
||||
"""
|
||||
target 'some_host.example'
|
||||
|
||||
task :test_target do
|
||||
condition { target == 'some_host.example' }
|
||||
|
||||
echo 'OK'
|
||||
end
|
||||
"""
|
||||
When I execute the recipe
|
||||
Then the output must contain "OK"
|
Reference in New Issue
Block a user