Class: RSpec::Core::Notifications::ExamplesNotification
- Inherits:
-
Object
- Object
- RSpec::Core::Notifications::ExamplesNotification
- Defined in:
- lib/rspec/core/notifications.rb
Overview
The ExamplesNotification
represents notifications sent by the reporter
which contain information about the suites examples.
Instance Method Summary (collapse)
-
- (Array<RSpec::Core::Example>) examples
List of examples.
-
- (Array<RSpec::Core::Example>) failed_examples
List of failed examples.
-
- (Array<RSpec::Core::Notifications::FailedExampleNotification>) failure_notifications
Returns failed examples as notifications.
-
- (String) fully_formatted_failed_examples(colorizer = ::RSpec::Core::Formatters::ConsoleCodes)
The list of failed examples, fully formatted in the way that RSpec's built-in formatters emit.
-
- (String) fully_formatted_pending_examples(colorizer = ::RSpec::Core::Formatters::ConsoleCodes)
The list of pending examples, fully formatted in the way that RSpec's built-in formatters emit.
-
- (ExamplesNotification) initialize(reporter)
constructor
A new instance of ExamplesNotification.
-
- (Array<RSpec::Core::Notifications::ExampleNotification>) notifications
Returns examples as notifications.
-
- (Array<RSpec::Core::Example>) pending_examples
List of pending examples.
-
- (Array<RSpec::Core::Notifications::SkippedExampleNotification, RSpec::Core::Notifications::PendingExampleFailedAsExpectedNotification>) pending_notifications
returns pending examples as notifications.
Constructor Details
- (ExamplesNotification) initialize(reporter)
Returns a new instance of ExamplesNotification
66 67 68 |
# File 'lib/rspec/core/notifications.rb', line 66 def initialize(reporter) @reporter = reporter end |
Instance Method Details
- (Array<RSpec::Core::Example>) examples
Returns list of examples
71 72 73 |
# File 'lib/rspec/core/notifications.rb', line 71 def examples @reporter.examples end |
- (Array<RSpec::Core::Example>) failed_examples
Returns list of failed examples
76 77 78 |
# File 'lib/rspec/core/notifications.rb', line 76 def failed_examples @reporter.failed_examples end |
- (Array<RSpec::Core::Notifications::FailedExampleNotification>) failure_notifications
Returns failed examples as notifications
93 94 95 |
# File 'lib/rspec/core/notifications.rb', line 93 def failure_notifications @failed_notifications ||= format_examples(failed_examples) end |
- (String) fully_formatted_failed_examples(colorizer = ::RSpec::Core::Formatters::ConsoleCodes)
Returns The list of failed examples, fully formatted in the way that RSpec's built-in formatters emit.
106 107 108 109 110 111 112 113 114 |
# File 'lib/rspec/core/notifications.rb', line 106 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 |
- (String) fully_formatted_pending_examples(colorizer = ::RSpec::Core::Formatters::ConsoleCodes)
Returns The list of pending examples, fully formatted in the way that RSpec's built-in formatters emit.
118 119 120 121 122 123 124 125 126 |
# File 'lib/rspec/core/notifications.rb', line 118 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 |
- (Array<RSpec::Core::Notifications::ExampleNotification>) notifications
Returns examples as notifications
87 88 89 |
# File 'lib/rspec/core/notifications.rb', line 87 def notifications @notifications ||= format_examples(examples) end |
- (Array<RSpec::Core::Example>) pending_examples
Returns list of pending examples
81 82 83 |
# File 'lib/rspec/core/notifications.rb', line 81 def pending_examples @reporter.pending_examples end |
- (Array<RSpec::Core::Notifications::SkippedExampleNotification, RSpec::Core::Notifications::PendingExampleFailedAsExpectedNotification>) pending_notifications
returns pending examples as notifications
100 101 102 |
# File 'lib/rspec/core/notifications.rb', line 100 def pending_notifications @pending_notifications ||= format_examples(pending_examples) end |