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

Commit 910eb7f

Browse files
authored
Merge pull request #2313 from rspec/myron/make-spec-resilient
Make spec resilient to changes to this spec file.
2 parents b54e2a1 + 3512b23 commit 910eb7f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spec/rspec/core/formatters/exception_presenter_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ module RSpec::Core
136136
instance_double(Exception, :cause => first_exception, :message => "Second\nexception", :backtrace => ["#{__FILE__}:#{__LINE__}"])
137137
end
138138

139+
caused_by_line_num = __LINE__ + 2
139140
let(:first_exception) do
140141
instance_double(Exception, :cause => nil, :message => "Real\nculprit", :backtrace => ["#{__FILE__}:#{__LINE__}"])
141142
end
@@ -155,7 +156,7 @@ module RSpec::Core
155156
| # --- Caused by: ---
156157
| # Real
157158
| # culprit
158-
| # ./spec/rspec/core/formatters/exception_presenter_spec.rb:140
159+
| # ./spec/rspec/core/formatters/exception_presenter_spec.rb:#{caused_by_line_num}
159160
EOS
160161
end
161162

0 commit comments

Comments
 (0)