Class: RSpec::Core::Bisect::Notifier

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/core/bisect/utilities.rb

Overview

Wraps a `formatter` providing a simple means to notify it in place of an `RSpec::Core::Reporter`, without involving configuration in any way.

Instance Method Summary collapse

Constructor Details

#initialize(formatter) ⇒ Notifier

Returns a new instance of Notifier



20
21
22
# File 'lib/rspec/core/bisect/utilities.rb', line 20

def initialize(formatter)
  @formatter = formatter
end

Instance Method Details

#publish(event, *args) ⇒ Object



24
25
26
27
28
# File 'lib/rspec/core/bisect/utilities.rb', line 24

def publish(event, *args)
  return unless @formatter.respond_to?(event)
  notification = Notifications::CustomNotification.for(*args)
  @formatter.__send__(event, notification)
end