mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Fix nil exception when reporting rspec failures (#25011)
Follow-up to f5ca96528d
Why this change?
`RSpec.current_example.metadata[:extra_failure_lines]` can be `nil` and
calling `<<` on `nil` is not a good idea.
What does this change do?
Set `RSpec.current_example.metadata[:extra_failure_lines]` to `""` as
long as there are exceptions.
This commit is contained in:
committed by
GitHub
parent
d3625f2288
commit
9d658591d6
@@ -582,7 +582,7 @@ RSpec.configure do |config|
|
||||
|
||||
config.after :each do |example|
|
||||
if example.exception && RspecErrorTracker.exceptions.present?
|
||||
lines = RSpec.current_example.metadata[:extra_failure_lines]
|
||||
lines = (RSpec.current_example.metadata[:extra_failure_lines] ||= "")
|
||||
|
||||
lines << "~~~~~~~ SERVER EXCEPTIONS ~~~~~~~"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user