Skip to content

Instantly share code, notes, and snippets.

@mmcdaris
Last active January 15, 2021 15:02
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mmcdaris/3926ab80079955ae3fd2dd3181a83ecc to your computer and use it in GitHub Desktop.
Exclude gem lines from RSpec backtrace

Purpose

Excludes gem related lines in your rspec backtraces.
Useful when you only want to see backtrace lines from your app and spec code.

example .rspec file

note: path to helper file is relative

# File: .rspec
--require ./tmp/rspec_helper.rb

example helper file

# File: ./tmp/rspec_helper.rb
RSpec.configure do |config|
  config.backtrace_exclusion_patterns << /.*gems.*/
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment