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
-
(Array(RSpec::Core::Example))
- list of examples
def examples @reporter.examples end
def failed_examples
-
(Array(RSpec::Core::Example))
- list of failed examples
def failed_examples @reporter.failed_examples end
def failure_notifications
-
(Array(Rspec::Core::Notifications::FailedExampleNotification])
- Array(Rspec::Core::Notifications::FailedExampleNotification]
def failure_notifications @failed_notifications ||= format(failed_examples) end
def format(examples)
def format(examples) examples.map do |example| ExampleNotification.for(example) end end
def fully_formatted_failed_examples(colorizer = ::RSpec::Core::Formatters::ConsoleCodes)
-
(String)
- The list of failed examples, fully formatted in the way that
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)
-
(String)
- The list of pending examples, fully formatted in the way that
def fully_formatted_pending_examples(colorizer = ::RSpec::Core::Formatters::ConsoleCodes) formatted = "\nPending:\n" pending_examples.each do |example| formatted_caller = RSpec.configuration.backtrace_formatter.backtrace_line(example.location) formatted << " #{colorizer.wrap(example.full_description, :pending)}\n" << " # #{colorizer.wrap(example.execution_result.pending_message, :detail)}\n" << " # #{colorizer.wrap(formatted_caller, :detail)}\n" end formatted end
def initialize(reporter)
def initialize(reporter) @reporter = reporter end
def notifications
-
(Array(Rspec::Core::Notifications::ExampleNotification])
- Array(Rspec::Core::Notifications::ExampleNotification]
def notifications @notifications ||= format(examples) end
def pending_examples
-
(Array(RSpec::Core::Example))
- list of pending examples
def pending_examples @reporter.pending_examples end