Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

Commit

Permalink
add pending feature - conditional exclusion of example groups
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Feb 7, 2009
1 parent c5328f5 commit 6b35223
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cucumber.yml
@@ -1 +1,2 @@
default: --require features features
default: --require features features
pending: --require features features-pending
39 changes: 39 additions & 0 deletions 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
Copy link
Contributor

@bmabey bmabey commented on 6b35223 Feb 7, 2009

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.