Class: RSpec::TAP::Formatters::Compact
- Inherits:
-
Core::Formatters::BaseFormatter
- Object
- Core::Formatters::BaseFormatter
- RSpec::TAP::Formatters::Compact
- Defined in:
- lib/rspec/tap/formatters/compact.rb
Overview
Compact 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 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) ⇒ Compact
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
#initialize(output) ⇒ Compact
Constructor
34 35 36 37 38 39 40 41 42 |
# File 'lib/rspec/tap/formatters/compact.rb', line 34 def initialize(output) super @printer = Printer.new(output) @test_stats = TestStats.new @seed = nil @level = 0 @example_number = 0 end |
Instance Method Details
#dump_failures(notification)
Failure examples notification
148 149 150 |
# File 'lib/rspec/tap/formatters/compact.rb', line 148 def dump_failures(notification) @printer.store_failed_examples_summary(notification) end |
#dump_pending(notification)
Pending examples notification
155 156 157 |
# File 'lib/rspec/tap/formatters/compact.rb', line 155 def dump_pending(notification) @printer.store_pending_examples_summary(notification) end |
#dump_summary(notification)
Examples summary notification
162 163 164 |
# File 'lib/rspec/tap/formatters/compact.rb', line 162 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 |
# File 'lib/rspec/tap/formatters/compact.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 ) end |
#example_group_finished(notification)
Example group finish notification
80 81 82 83 84 85 86 87 88 |
# File 'lib/rspec/tap/formatters/compact.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/compact.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/compact.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
127 128 129 130 131 132 133 134 135 136 |
# File 'lib/rspec/tap/formatters/compact.rb', line 127 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/compact.rb', line 93 def example_started(_notification) @example_number += 1 end |
#message(notification)
Failure outside of example notification
141 142 143 |
# File 'lib/rspec/tap/formatters/compact.rb', line 141 def (notification) @printer.(notification) end |
#seed(notification)
Seed notification
47 48 49 |
# File 'lib/rspec/tap/formatters/compact.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/compact.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/compact.rb', line 63 def start_dump(_notification) @printer.example_progress_dump end |