From 6b35223b547488e024c0d86b0ca9298437e49769 Mon Sep 17 00:00:00 2001 From: David Chelimsky Date: Sat, 7 Feb 2009 01:49:16 -0600 Subject: [PATCH] add pending feature - conditional exclusion of example groups --- cucumber.yml | 3 +- .../cli/conditional_exclusion.feature | 39 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 features-pending/cli/conditional_exclusion.feature diff --git a/cucumber.yml b/cucumber.yml index 89f6c695b..840f3a623 100644 --- a/cucumber.yml +++ b/cucumber.yml @@ -1 +1,2 @@ -default: --require features features \ No newline at end of file +default: --require features features +pending: --require features features-pending \ No newline at end of file diff --git a/features-pending/cli/conditional_exclusion.feature b/features-pending/cli/conditional_exclusion.feature new file mode 100644 index 000000000..6cf36f7d6 --- /dev/null +++ b/features-pending/cli/conditional_exclusion.feature @@ -0,0 +1,39 @@ +Feature: conditional exclusion of example groups + + Example groups can be excluded from a run by matching the value of the + --exclude argument against options passed to an example group. The value + can be a key or a key:value pair (separated by a ":"). + + Scenario: exclusion using explicit value + Given the following spec: + """ + describe "This should run" do + it { 5.should == 5 } + end + + describe "This should not run", :slow => true do + it { 1_000_000.times { 5.should == 5 } } + end + """ + When I run it with the spec command --format specdoc --exclude slow:true + Then the exit code should be 0 + And the stdout should match "1 example, 0 failures" + And the stdout should match /This should run$/m + But the stdout should not match "This should not run" + + Scenario: exclusion using default value (true) + Given the following spec: + """ + describe "This should run" do + it { 5.should == 5 } + end + + describe "This should not run", :slow => true do + it { 1_000_000.times { 5.should == 5 } } + end + """ + When I run it with the spec command --format specdoc --exclude slow + Then the exit code should be 0 + And the stdout should match "1 example, 0 failures" + And the stdout should match /This should run$/m + But the stdout should not match "This should not run"