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

Commit ebbea9f

Browse files
committed
Refactor: support FailedExampleNotification.new(example).
Previously, a second `exception_presenter` argument was required.
1 parent de49f81 commit ebbea9f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/rspec/core/notifications.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ def self.for(example)
5151
FailedExampleNotification
5252
end
5353

54-
exception_presenter = Formatters::ExceptionPresenter::Factory.new(example).build
55-
klass.new(example, exception_presenter)
54+
klass.new(example)
5655
end
5756

5857
private_class_method :new
@@ -202,7 +201,7 @@ def fully_formatted(failure_number, colorizer=::RSpec::Core::Formatters::Console
202201

203202
private
204203

205-
def initialize(example, exception_presenter)
204+
def initialize(example, exception_presenter=Formatters::ExceptionPresenter::Factory.new(example).build)
206205
@exception_presenter = exception_presenter
207206
super(example)
208207
end

0 commit comments

Comments
 (0)