Class: RSpec::Core::Notifications::ExampleNotification
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
|
|
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Struct
|
|
Instance Chain:
self,
Struct
|
|
Inherits: |
Struct
|
Defined in: | rspec-core/lib/rspec/core/notifications.rb, rspec-core/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.
Class Method Summary
- .for(example) Internal use only Internal use only
Instance Attribute Summary
-
#example
rw
The
ExampleNotification
represents notifications sent by the reporter which contain information about the current (or soon to be) example.
Class Method Details
.for(example)
This method is for internal use only.
[ GitHub ]
# File 'rspec-core/lib/rspec/core/notifications.rb', line 41
def self.for(example) execution_result = example.execution_result return SkippedExampleNotification.new(example) if execution_result.example_skipped? return new(example) unless execution_result.status == :pending || execution_result.status == :failed klass = if execution_result.pending_fixed? PendingExampleFixedNotification elsif execution_result.status == :pending PendingExampleFailedAsExpectedNotification else FailedExampleNotification end klass.new(example) end
Instance Attribute Details
#example (rw)
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.
# File 'rspec-core/lib/rspec/core/notifications.rb', line 38
ExampleNotification = Struct.new(:example)