From 675871c3f5f0897260037fbd8d5e6ca826f53702 Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Mon, 22 Sep 2014 20:20:37 +0000 Subject: [PATCH] Improve cucumber feature for negated test prefix --- ...feature => condition_negated_test.feature} | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) rename features/{test_negated_test.feature => condition_negated_test.feature} (62%) diff --git a/features/test_negated_test.feature b/features/condition_negated_test.feature similarity index 62% rename from features/test_negated_test.feature rename to features/condition_negated_test.feature index 4ebbba8..204c888 100644 --- a/features/test_negated_test.feature +++ b/features/condition_negated_test.feature @@ -1,40 +1,47 @@ -@sshd 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 { env? :shell } + condition { even? 4 } echo 'successful_test' end task :negated_test do - condition { no_env? :shell } + condition { no_even? 4 } echo 'negated_test' end """ - When I successfully execute the recipe on remote target + 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 + 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 { env? :inexistent_var } + condition { even? 5 } echo 'failing_test' end task :negated_test do - condition { no_env? :inexistent_var } + condition { no_even? 5 } echo 'negated_test' end """ - When I successfully execute the recipe on remote target + When I successfully execute the recipe Then the output must not contain "failing_test" And the output must contain "negated_test"