forked from rspec/rspec-core
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some regression tests for some popular custom formatter gems.
For rspec#1291.
- Loading branch information
1 parent
f184fa6
commit 2b2468e
Showing
4 changed files
with
92 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
Feature: Regression tests for legacy custom formatters | ||
|
||
Background: | ||
Given a file named "spec/passing_and_failing_spec.rb" with: | ||
"""ruby | ||
RSpec.describe "Some examples" do | ||
it "passes" do | ||
expect(1).to eq(1) | ||
end | ||
it "fails" do | ||
expect(1).to eq(2) | ||
end | ||
context "nested" do | ||
it "passes" do | ||
expect(1).to eq(1) | ||
end | ||
it "fails" do | ||
expect(1).to eq(2) | ||
end | ||
end | ||
end | ||
""" | ||
And a file named "spec/pending_spec.rb" with: | ||
"""ruby | ||
RSpec.describe "Some pending examples" do | ||
context "pending" do | ||
it "is reported as pending" do | ||
pending { expect(1).to eq(2) } | ||
end | ||
it "is reported as failing" do | ||
pending { expect(1).to eq(1) } | ||
end | ||
end | ||
end | ||
""" | ||
|
||
@wip @announce | ||
Scenario: Use fuubar formatter | ||
When I run `rspec --format Fuubar` | ||
Then the output should contain "Progress: |============" | ||
And the output should contain "6 examples, 3 failures, 1 pending" | ||
And the output should contain "The Fuubar formatter uses the deprecated formatter interface" | ||
But the output should not contain any error backtraces | ||
|
||
Scenario: Use rspec-instafail formatter | ||
When I run `rspec --format RSpec::Instafail` | ||
Then the output should contain "6 examples, 3 failures, 1 pending" | ||
And the output should contain "The RSpec::Instafail formatter uses the deprecated formatter interface" | ||
But the output should not contain any error backtraces | ||
|
||
Scenario: Use rspec-extra-formatters JUnit formatter | ||
When I run `rspec --require rspec-extra-formatters --format JUnitFormatter` | ||
Then the output should contain: | ||
""" | ||
<testsuite errors="0" failures="3" skipped="1" tests="6" | ||
""" | ||
And the output should contain "The JUnitFormatter formatter uses the deprecated formatter interface" | ||
But the output should not contain any error backtraces | ||
|
||
@wip @announce | ||
Scenario: Use rspec-extra-formatters Tap formatter | ||
When I run `rspec --require rspec-extra-formatters --format TapFormatter` | ||
Then the output should contain "TAP version 13" | ||
And the output should contain "The TapFormatter formatter uses the deprecated formatter interface" | ||
But the output should not contain any error backtraces | ||
|
||
@wip @announce | ||
Scenario: Use rspec-spinner formatter | ||
When I run `rspec --require rspec_spinner --format RspecSpinner::Spinner` | ||
Then the output should contain "TBD" | ||
|
||
@wip @announce | ||
Scenario: Use nyancat formatter | ||
When I run `rspec --format NyanCatFormatter` | ||
Then the output should contain "TBD" | ||
|
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