The `ExamplesNotification` represents notifications sent by the reporter which contain information about the suites examples.
@example
def stop(notification) puts "Hey I ran #{notification.examples.size}" end
@return [Array(RSpec::Core::Example)] list of examples
# File lib/rspec/core/notifications.rb, line 63 def examples @reporter.examples end
@return [Array(RSpec::Core::Example)] list of failed examples
# File lib/rspec/core/notifications.rb, line 68 def failed_examples @reporter.failed_examples end
@return [Array(Rspec::Core::Notifications::FailedExampleNotification]
returns failed examples as notifications
# File lib/rspec/core/notifications.rb, line 85 def failure_notifications @failed_notifications ||= format(failed_examples) end
@return [String] The list of failed examples, fully formatted in the way that
RSpec's built-in formatters emit.
# File lib/rspec/core/notifications.rb, line 91 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
@return [String] The list of pending examples, fully formatted in the way that
RSpec's built-in formatters emit.
# File lib/rspec/core/notifications.rb, line 103 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
@return [Array(Rspec::Core::Notifications::ExampleNotification]
returns examples as notifications
# File lib/rspec/core/notifications.rb, line 79 def notifications @notifications ||= format(examples) end
@return [Array(RSpec::Core::Example)] list of pending examples
# File lib/rspec/core/notifications.rb, line 73 def pending_examples @reporter.pending_examples end
Generated with the Darkfish Rdoc Generator 2.