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

Commit 7fb22e9

Browse files
committed
Limiting string allocations in skipped example notifications.
1 parent 4b7565a commit 7fb22e9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/rspec/core/notifications.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,14 @@ class SkippedExampleNotification < ExampleNotification
232232
# RSpec's built-in formatters emit.
233233
def fully_formatted(pending_number, colorizer=::RSpec::Core::Formatters::ConsoleCodes)
234234
formatted_caller = RSpec.configuration.backtrace_formatter.backtrace_line(example.location)
235-
colorizer.wrap("\n #{pending_number}) #{example.full_description}", :pending) + "\n " +
236-
Formatters::ExceptionPresenter::PENDING_DETAIL_FORMATTER.call(example, colorizer) +
237-
"\n" + colorizer.wrap(" # #{formatted_caller}\n", :detail)
235+
236+
[
237+
colorizer.wrap("\n #{pending_number}) #{example.full_description}", :pending),
238+
"\n ",
239+
Formatters::ExceptionPresenter::PENDING_DETAIL_FORMATTER.call(example, colorizer),
240+
"\n",
241+
colorizer.wrap(" # #{formatted_caller}\n", :detail)
242+
].join("")
238243
end
239244
end
240245

0 commit comments

Comments
 (0)