This repository has been archived by the owner on Oct 27, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add pending feature - conditional exclusion of example groups
- Loading branch information
1 parent
c5328f5
commit 6b35223
Showing
2 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
default: --require features features | ||
default: --require features features | ||
pending: --require features features-pending |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
6b35223
There was a problem hiding this comment.
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
6b35223
There was a problem hiding this comment.
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