class RSpec::Core::Notifications::ExampleNotification

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/rspec/core/notifications.rbs

class RSpec::Core::Notifications::ExampleNotification
  def self.for: (RSpec::Core::Example example) -> RSpec::Core::Notifications::ExampleNotification
end

def self.for(example)

Experimental RBS support (using type sampling data from the type_fusion project).

def self.for: (RSpec::Core::Example example) -> RSpec::Core::Notifications::ExampleNotification

This signature was generated using 2 samples from 1 application.

Other tags:
    Private: -
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