class RSpec::Core::Notifications::ExamplesNotification


end
puts “Hey I ran #{notification.examples.size}”
def stop(notification)
@example
which contain information about the suites examples.
The ‘ExamplesNotification` represents notifications sent by the reporter

def examples

Returns:
  • (Array) - list of examples
def examples
  @reporter.examples
end

def failed_examples

Returns:
  • (Array) - list of failed examples
def failed_examples
  @reporter.failed_examples
end

def failure_notifications

Returns:
  • (Array) -
def failure_notifications
  @failed_notifications ||= format_examples(failed_examples)
end

def format_examples(examples)

def format_examples(examples)
  examples.map do |example|
    ExampleNotification.for(example)
  end
end

def fully_formatted_failed_examples(colorizer=::RSpec::Core::Formatters::ConsoleCodes)

Returns:
  • (String) - The list of failed examples, fully formatted in the way
def fully_formatted_failed_examples(colorizer=::RSpec::Core::Formatters::ConsoleCodes)
  formatted = "\nFailures:\n"
  failure_notifications.each_with_index do |failure, index|
    formatted << failure.fully_formatted(index.next, colorizer)
  end
  formatted
end

def fully_formatted_pending_examples(colorizer=::RSpec::Core::Formatters::ConsoleCodes)

Returns:
  • (String) - The list of pending examples, fully formatted in the
def fully_formatted_pending_examples(colorizer=::RSpec::Core::Formatters::ConsoleCodes)
  formatted = "\nPending: (Failures listed here are expected and do not affect your suite's status)\n"
  pending_notifications.each_with_index do |notification, index|
    formatted << notification.fully_formatted(index.next, colorizer)
  end
  formatted
end

def initialize(reporter)

def initialize(reporter)
  @reporter = reporter
end

def notifications

Returns:
  • (Array) -
def notifications
  @notifications ||= format_examples(examples)
end

def pending_examples

Returns:
  • (Array) - list of pending examples
def pending_examples
  @reporter.pending_examples
end

def pending_notifications

Returns:
  • (Array - Array
def pending_notifications
  @pending_notifications ||= format_examples(pending_examples)
end