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

Commit ab8bf5c

Browse files
committed
Remove bundler lines from backtraces locally
1 parent 247d0a7 commit ab8bf5c

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

spec/integration/spec_file_load_errors_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
RSpec.configure do |c|
2525
c.filter_gems_from_backtrace "gems/aruba"
26+
c.filter_gems_from_backtrace "gems/bundler"
2627
c.backtrace_exclusion_patterns << %r{/rspec-core/spec/} << %r{rspec_with_simplecov}
2728
c.failure_exit_code = failure_exit_code
2829
c.error_exit_code = error_exit_code

spec/integration/suite_hooks_errors_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
RSpec.configure do |c|
2727
c.filter_gems_from_backtrace "gems/aruba"
28+
c.filter_gems_from_backtrace "gems/bundler"
2829
c.backtrace_exclusion_patterns << %r{/rspec-core/spec/} << %r{rspec_with_simplecov}
2930
c.failure_exit_code = failure_exit_code
3031
c.error_exit_code = error_exit_code

spec/support/formatter_support.rb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def run_rspec_with_formatter(formatter, options={})
3333

3434
runner = RSpec::Core::Runner.new(options)
3535
configuration = runner.configuration
36+
configuration.filter_gems_from_backtrace "gems/bundler"
3637
configuration.backtrace_formatter.exclusion_patterns << /rspec_with_simplecov/
3738
configuration.backtrace_formatter.inclusion_patterns = []
3839

@@ -41,6 +42,7 @@ def run_rspec_with_formatter(formatter, options={})
4142
runner.run(err, out)
4243
out.string
4344
end
45+
RUN_LINE = __LINE__ - 3
4446

4547
def normalize_durations(output)
4648
output.gsub(/(?:\d+ minutes? )?\d+(?:\.\d+)?(s| seconds?)/) do |dur|
@@ -67,7 +69,7 @@ def expected_summary_output_for_example_specs
6769
|
6870
| (compared using ==)
6971
| # ./spec/rspec/core/resources/formatter_specs.rb:18
70-
| # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter'
72+
| # ./spec/support/formatter_support.rb:#{RUN_LINE}:in `run_rspec_with_formatter'
7173
| # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter'
7274
| # ./spec/support/sandboxing.rb:16
7375
| # ./spec/support/sandboxing.rb:7
@@ -87,7 +89,7 @@ def expected_summary_output_for_example_specs
8789
|
8890
| (compared using ==)
8991
| # ./spec/rspec/core/resources/formatter_specs.rb:37
90-
| # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter'
92+
| # ./spec/support/formatter_support.rb:#{RUN_LINE}:in `run_rspec_with_formatter'
9193
| # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter'
9294
| # ./spec/support/sandboxing.rb:16
9395
| # ./spec/support/sandboxing.rb:7
@@ -109,7 +111,7 @@ def expected_summary_output_for_example_specs
109111
| got: 3
110112
|
111113
| (compared using ==)
112-
| # ./spec/rspec/core/resources/formatter_specs.rb:42
114+
| # ./spec/rspec/core/resources/formatter_specs.rb:41
113115
|
114116
| 4) a failing spec with odd backtraces fails with a backtrace that has no file
115117
| Failure/Error: Unable to find (erb) to read failed line
@@ -162,7 +164,7 @@ def expected_summary_output_for_example_specs
162164
|
163165
| (compared using ==)
164166
| # ./spec/rspec/core/resources/formatter_specs.rb:18:in `block (3 levels) in <top (required)>'
165-
| # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter'
167+
| # ./spec/support/formatter_support.rb:#{RUN_LINE}:in `run_rspec_with_formatter'
166168
| # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter'
167169
| # ./spec/support/sandboxing.rb:16:in `block (3 levels) in <top (required)>'
168170
| # ./spec/support/sandboxing.rb:7:in `block (2 levels) in <top (required)>'
@@ -182,7 +184,7 @@ def expected_summary_output_for_example_specs
182184
|
183185
| (compared using ==)
184186
| # ./spec/rspec/core/resources/formatter_specs.rb:37:in `block (2 levels) in <top (required)>'
185-
| # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter'
187+
| # ./spec/support/formatter_support.rb:#{RUN_LINE}:in `run_rspec_with_formatter'
186188
| # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter'
187189
| # ./spec/support/sandboxing.rb:16:in `block (3 levels) in <top (required)>'
188190
| # ./spec/support/sandboxing.rb:7:in `block (2 levels) in <top (required)>'
@@ -213,7 +215,7 @@ def expected_summary_output_for_example_specs
213215
| foo
214216
| # (erb):1:in `<main>'
215217
| # ./spec/rspec/core/resources/formatter_specs.rb:50:in `block (2 levels) in <top (required)>'
216-
| # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter'
218+
| # ./spec/support/formatter_support.rb:#{RUN_LINE}:in `run_rspec_with_formatter'
217219
| # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter'
218220
| # ./spec/support/sandboxing.rb:16:in `block (3 levels) in <top (required)>'
219221
| # ./spec/support/sandboxing.rb:7:in `block (2 levels) in <top (required)>'

0 commit comments

Comments
 (0)