Class: RSpec::TAP::Formatters::Default
- Inherits:
-
Core::Formatters::BaseFormatter
- Object
- Core::Formatters::BaseFormatter
- RSpec::TAP::Formatters::Default
- Defined in:
- lib/rspec/tap/formatters/default.rb
Overview
Default TAP formatter
Constant Summary collapse
- NOTIFICATIONS =
List of subscribed notifications
%i[ seed start start_dump example_group_started example_group_finished example_started example_passed example_failed example_pending message dump_failures dump_pending dump_summary ].freeze
Instance Method Summary collapse
-
#dump_failures(notification)
Failure examples notification.
-
#dump_pending(notification)
Pending examples notification.
-
#dump_summary(notification)
Examples summary notification.
-
#example_failed(notification)
Failing example notification.
-
#example_group_finished(notification)
Example group finish notification.
-
#example_group_started(notification)
Example group start notification.
-
#example_passed(notification)
Passing example notification.
-
#example_pending(notification)
Pending example notification.
-
#example_started(_notification)
Example start notification.
-
#initialize(output) ⇒ Default
constructor
Constructor.
-
#message(notification)
Failure outside of example notification.
-
#seed(notification)
Seed notification.
-
#start(notification)
Start notification.
-
#start_dump(_notification)
Execution finished notification.
Constructor Details
Instance Method Details
#dump_failures(notification)
Failure examples notification
149 150 151 |
# File 'lib/rspec/tap/formatters/default.rb', line 149 def dump_failures(notification) @printer.store_failed_examples_summary(notification) end |
#dump_pending(notification)
Pending examples notification
156 157 158 |
# File 'lib/rspec/tap/formatters/default.rb', line 156 def dump_pending(notification) @printer.store_pending_examples_summary(notification) end |
#dump_summary(notification)
Examples summary notification
163 164 165 |
# File 'lib/rspec/tap/formatters/default.rb', line 163 def dump_summary(notification) @printer.summary_output(notification, @seed) end |
#example_failed(notification)
Failing example notification
113 114 115 116 117 118 119 120 121 122 |
# File 'lib/rspec/tap/formatters/default.rb', line 113 def example_failed(notification) @test_stats.populate(notification, 2) @printer.example_progress_output(:failure) @printer.failure_output( notification.example.description.strip, @example_number, @level ) @printer.failure_reason_output(notification, @level + 1) end |
#example_group_finished(notification)
Example group finish notification
80 81 82 83 84 85 86 87 88 |
# File 'lib/rspec/tap/formatters/default.rb', line 80 def example_group_finished(notification) @printer.group_finished_output( @test_stats.data[notification.group.[:line_number]], @level ) @level -= 1 if @level.positive? @test_stats = TestStats.new if @level.zero? end |
#example_group_started(notification)
Example group start notification
70 71 72 73 74 75 |
# File 'lib/rspec/tap/formatters/default.rb', line 70 def example_group_started(notification) @printer.group_start_output(notification, @level) @level += 1 @example_number = 0 end |
#example_passed(notification)
Passing example notification
100 101 102 103 104 105 106 107 108 |
# File 'lib/rspec/tap/formatters/default.rb', line 100 def example_passed(notification) @test_stats.populate(notification, 1) @printer.example_progress_output(:success) @printer.success_output( notification.example.description.strip, @example_number, @level ) end |
#example_pending(notification)
Pending example notification
128 129 130 131 132 133 134 135 136 137 |
# File 'lib/rspec/tap/formatters/default.rb', line 128 def example_pending(notification) @test_stats.populate(notification, 3) @printer.example_progress_output(:pending) @printer.pending_output( notification, notification.example.description.strip, @example_number, @level ) end |
#example_started(_notification)
Example start notification
93 94 95 |
# File 'lib/rspec/tap/formatters/default.rb', line 93 def example_started(_notification) @example_number += 1 end |
#message(notification)
Failure outside of example notification
142 143 144 |
# File 'lib/rspec/tap/formatters/default.rb', line 142 def (notification) @printer.(notification) end |
#seed(notification)
Seed notification
47 48 49 |
# File 'lib/rspec/tap/formatters/default.rb', line 47 def seed(notification) @seed = notification.seed if notification.seed_used? end |
#start(notification)
Start notification
54 55 56 57 58 |
# File 'lib/rspec/tap/formatters/default.rb', line 54 def start(notification) super @printer.start_output end |
#start_dump(_notification)
Execution finished notification
63 64 65 |
# File 'lib/rspec/tap/formatters/default.rb', line 63 def start_dump(_notification) @printer.example_progress_dump end |