Method: RSpec::Core::Reporter#publish

Defined in:
lib/rspec/core/reporter.rb

#publish(event, options = {}) ⇒ void

Publish a custom event to supporting registered formatters.

Parameters:

  • event (Symbol)

    Name of the custom event to trigger on formatters

  • options (Hash) (defaults to: {})

    Hash of arguments to provide via CustomNotification

See Also:


108
109
110
111
112
113
114
# File 'lib/rspec/core/reporter.rb', line 108

def publish(event, options={})
  if RSPEC_NOTIFICATIONS.include? event
    raise "RSpec::Core::Reporter#publish is intended for sending custom " \
          "events not internal RSpec ones, please rename your custom event."
  end
  notify event, Notifications::CustomNotification.for(options)
end