Class: RSpec::Core::Notifications::ExampleNotification

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

Overview

The ExampleNotification represents notifications sent by the reporter which contain information about the current (or soon to be) example. It is used by formatters to access information about that example.

Examples:

def example_started(notification)
  puts "Hey I started #{notification.example.description}"
end

Direct Known Subclasses

FailedExampleNotification, SkippedExampleNotification

Instance Attribute Summary (collapse)

Instance Attribute Details

- (RSpec::Core::Example) example

the current example

Returns:

38
39
40
# File 'lib/rspec/core/notifications.rb', line 38
def example
  @example
end