Class: RSpec::TAP::Formatters::Flat
- Inherits:
-
Core::Formatters::BaseFormatter
- Object
- Core::Formatters::BaseFormatter
- RSpec::TAP::Formatters::Flat
- Defined in:
- lib/rspec/tap/formatters/flat.rb
Overview
Flat TAP formatter
Constant Summary collapse
- NOTIFICATIONS =
List of subscribed notifications
i[ seed start start_dump 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_passed(notification)
Passing example notification.
-
#example_pending(notification)
Pending example notification.
-
#example_started(_notification)
Example start notification.
-
#initialize(output) ⇒ Flat
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) ⇒ Flat
Constructor
32 33 34 35 36 37 38 |
# File 'lib/rspec/tap/formatters/flat.rb', line 32 def initialize(output) super @printer = Printer.new(output) @seed = nil @example_number = 0 end |
Instance Method Details
#dump_failures(notification)
Failure examples notification
119 120 121 |
# File 'lib/rspec/tap/formatters/flat.rb', line 119 def dump_failures(notification) @printer.store_failed_examples_summary(notification) end |
#dump_pending(notification)
Pending examples notification
126 127 128 |
# File 'lib/rspec/tap/formatters/flat.rb', line 126 def dump_pending(notification) @printer.store_pending_examples_summary(notification) end |
#dump_summary(notification)
Examples summary notification
133 134 135 |
# File 'lib/rspec/tap/formatters/flat.rb', line 133 def dump_summary(notification) @printer.summary_output(notification, @seed) end |
#example_failed(notification)
Failing example notification
85 86 87 88 89 90 91 92 93 |
# File 'lib/rspec/tap/formatters/flat.rb', line 85 def example_failed(notification) @printer.example_progress_output(:failure) @printer.failure_output( notification.example.full_description.strip, @example_number, 0 ) @printer.failure_reason_output(notification, 1) end |
#example_passed(notification)
Passing example notification
73 74 75 76 77 78 79 80 |
# File 'lib/rspec/tap/formatters/flat.rb', line 73 def example_passed(notification) @printer.example_progress_output(:success) @printer.success_output( notification.example.full_description.strip, @example_number, 0 ) end |
#example_pending(notification)
Pending example notification
99 100 101 102 103 104 105 106 107 |
# File 'lib/rspec/tap/formatters/flat.rb', line 99 def example_pending(notification) @printer.example_progress_output(:pending) @printer.pending_output( notification, notification.example.full_description.strip, @example_number, 0 ) end |
#example_started(_notification)
Example start notification
66 67 68 |
# File 'lib/rspec/tap/formatters/flat.rb', line 66 def example_started(_notification) @example_number += 1 end |
#message(notification)
Failure outside of example notification
112 113 114 |
# File 'lib/rspec/tap/formatters/flat.rb', line 112 def (notification) @printer.(notification) end |
#seed(notification)
Seed notification
43 44 45 |
# File 'lib/rspec/tap/formatters/flat.rb', line 43 def seed(notification) @seed = notification.seed if notification.seed_used? end |
#start(notification)
Start notification
50 51 52 53 54 |
# File 'lib/rspec/tap/formatters/flat.rb', line 50 def start(notification) super @printer.start_output end |
#start_dump(_notification)
Execution finished notification
59 60 61 |
# File 'lib/rspec/tap/formatters/flat.rb', line 59 def start_dump(_notification) @printer.example_progress_dump end |