-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The rspec tag option allows allows you to include or exclude different specs. On our CI environment we actively use this to target testing on different components of our system.
- Loading branch information
1 parent
7e6d335
commit 21ed86b
Showing
5 changed files
with
58 additions
and
4 deletions.
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
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
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
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,13 @@ | ||
RSpec.describe do | ||
it "is slow", :slow do | ||
expect(true).to be true | ||
end | ||
|
||
it "is fast", :fast do | ||
expect(true).to be true | ||
end | ||
|
||
it "is not tagged"do | ||
expect(true).to be true | ||
end | ||
end |
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,25 @@ | ||
require "test_helpers" | ||
|
||
class TestTags < RSpecQTest | ||
def test_inclusion_filter | ||
queue = exec_build("tagged_suite", "--tag=slow") | ||
|
||
assert_processed_jobs [ | ||
"./spec/tagged_spec.rb", | ||
], queue | ||
|
||
assert_equal 1, queue.example_count | ||
end | ||
|
||
def test_exclusion_filter | ||
queue = exec_build("tagged_suite", "--tag=~slow") | ||
|
||
assert_equal 2, queue.example_count | ||
end | ||
|
||
def test_mixed_filter | ||
queue = exec_build("tagged_suite", "--tag=~slow --tag=~fast") | ||
|
||
assert_equal 1, queue.example_count | ||
end | ||
end |