Skip to content
Browse files

add pending feature - conditional exclusion of example groups

  • Loading branch information...
1 parent c5328f5 commit 6b35223b547488e024c0d86b0ca9298437e49769 @dchelimsky committed
Showing with 41 additions and 1 deletion.
  1. +2 −1 cucumber.yml
  2. +39 −0 features-pending/cli/conditional_exclusion.feature
View
3 cucumber.yml
@@ -1 +1,2 @@
-default: --require features features
+default: --require features features
+pending: --require features features-pending
View
39 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"

2 comments on commit 6b35223

@bmabey

I am so excited to have this feature.

One thought.. do you think we should keep the CLI options similar to cucumber’s new tagging ones?

http://rspec.lighthouseapp.com/projects/16211/tickets/194-be-able-to-exclude-tags-from-a-run

@dchelimsky
Owner

Can we have this conversation in the ticket?

http://rspec.lighthouseapp.com/projects/5645/tickets/682-conditional-exclusion-of-example-groups

Please sign in to comment.
Something went wrong with that request. Please try again.