class RSpec::Core::Notifications::ExampleNotification

Public Class Methods

for(example) click to toggle source

@private

# File lib/rspec/core/notifications.rb, line 38
def self.for(example)
  execution_result = example.execution_result

  if execution_result.pending_fixed?
    PendingExampleFixedNotification.new(example)
  elsif execution_result.example_skipped?
    SkippedExampleNotification.new(example)
  elsif execution_result.status == :pending
    PendingExampleFailedAsExpectedNotification.new(example)
  elsif execution_result.status == :failed
    FailedExampleNotification.new(example)
  else
    new(example)
  end
end