Class: RSpec::Core::Notifications::CustomNotification

Inherits:
Struct
  • Object
show all
Defined in:
lib/rspec/core/notifications.rb

Overview

CustomNotification is used when sending custom events to formatters / other registered listeners, it creates attributes based on supplied hash of options.

Class Method Summary (collapse)

Class Method Details

+ (CustomNotification) for(options = {})

Build a custom notification based on the supplied option key / values.

Parameters:

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

    A hash of method / value pairs to create on this notification

Returns:

493
494
495
496
# File 'lib/rspec/core/notifications.rb', line 493
def self.for(options={})
  return NullNotification if options.keys.empty?
  new(*options.keys).new(*options.values)
end