A custom RSpec formatter that suppresses detailed pending test output and shows only the count in the summary.
Add this line to your application's Gemfile:
gem 'rspec_pending_filter_formatter'And then execute:
bundle installOr install it yourself as:
gem install rspec_pending_filter_formatterYou can use this formatter by specifying it on the command line:
rspec --format RSpecPendingFilterFormatter::FormatterOr configure it in your .rspec file:
--format RSpecPendingFilterFormatter::Formatter
Or in your spec/spec_helper.rb:
RSpec.configure do |config|
config.formatter = RSpecPendingFilterFormatter::Formatter
endThis formatter extends the standard ProgressFormatter and modifies the behavior for pending tests:
- During test execution: Pending tests show the "*" character as usual
- No detailed output: File paths, line numbers, and reasons for pending tests are not displayed
- Summary: The count of pending tests is shown only in the final RSpec summary line
..*..F
Pending: (Failures listed here)
1) User registration validates email format
# Not yet implemented
# ./spec/user_spec.rb:15
Failures:
...
Finished in 0.5 seconds
5 examples, 1 failure, 1 pending
..*..F
Failures:
...
Finished in 0.5 seconds
5 examples, 1 failure, 1 pending
This formatter is useful when:
- You have many pending tests that clutter the output
- You want to focus on failures and successes during test execution
- You only need to know the count of pending tests in the summary, not the detailed reasons
After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests.
To install this gem onto your local machine, run bundle exec rake install.
Bug reports and pull requests are welcome on GitHub at https://github.com/willnet/rspec-pending-filter-formatter.
The gem is available as open source under the terms of the MIT License.