Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit

Permalink
fixup! Add a feature
Browse files Browse the repository at this point in the history
  • Loading branch information
pirj committed May 3, 2022
1 parent 3509e0d commit 1818d9d
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions features/configuration/pending_failure_output.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Feature: Pending failure output

Configure the format of pending examples output with an option (defaults to `:full`):

```ruby
RSpec.configure do |c|
c.pending_failure_output = :no_backtrace
end
```

Allowed options are `:full`, `:no_backtrace` and `:skip`.

Background:
Given a file named "spec/example_spec.rb" with:
"""ruby
require "spec_helper"
RSpec.describe "something" do
pending "will never happen again" do
expect(Time.now.year).to eq(2021)
end
end
"""

Scenario: By default outputs backtrace and details
Given a file named "spec/spec_helper.rb" with:
"""ruby
"""
When I run `rspec spec`
Then the examples should all pass
And the output should contain "Pending: (Failures listed here are expected and do not affect your suite's status)"
And the output should contain "1) something will never happen again"
And the output should contain "expected: 2021"
And the output should contain "./spec/example_spec.rb:5"

Scenario: Setting `pending_failure_output` to `:no_backtrace` hides the backtrace
Given a file named "spec/spec_helper.rb" with:
"""ruby
RSpec.configure { |c| c.pending_failure_output = :no_backtrace }
"""
When I run `rspec spec`
Then the examples should all pass
And the output should contain "Pending: (Failures listed here are expected and do not affect your suite's status)"
And the output should contain "1) something will never happen again"
And the output should contain "expected: 2021"
And the output should not contain "./spec/example_spec.rb:5"

Scenario: Setting `pending_failure_output` to `:skip` hides the backtrace
Given a file named "spec/spec_helper.rb" with:
"""ruby
RSpec.configure { |c| c.pending_failure_output = :skip }
"""
When I run `rspec spec`
Then the examples should all pass
And the output should not contain "Pending: (Failures listed here are expected and do not affect your suite's status)"
And the output should not contain "1) something will never happen again"
And the output should not contain "expected: 2021"
And the output should not contain "./spec/example_spec.rb:5"

0 comments on commit 1818d9d

Please sign in to comment.