Class: TurboTests::JsonRowsFormatter
- Inherits:
-
Object
- Object
- TurboTests::JsonRowsFormatter
- Defined in:
- lib/turbo_tests/json_rows_formatter.rb
Overview
An RSpec formatter used for each subprocess during parallel test execution
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #close(notification) ⇒ Object
- #example_failed(notification) ⇒ Object
- #example_passed(notification) ⇒ Object
- #example_pending(notification) ⇒ Object
-
#initialize(output) ⇒ JsonRowsFormatter
constructor
A new instance of JsonRowsFormatter.
- #message(notification) ⇒ Object
- #seed(notification) ⇒ Object
Constructor Details
#initialize(output) ⇒ JsonRowsFormatter
Returns a new instance of JsonRowsFormatter.
18 19 20 |
# File 'lib/turbo_tests/json_rows_formatter.rb', line 18 def initialize(output) @output = output end |
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
16 17 18 |
# File 'lib/turbo_tests/json_rows_formatter.rb', line 16 def output @output end |
Instance Method Details
#close(notification) ⇒ Object
38 39 40 |
# File 'lib/turbo_tests/json_rows_formatter.rb', line 38 def close(notification) output_row(type: :close) end |
#example_failed(notification) ⇒ Object
30 31 32 |
# File 'lib/turbo_tests/json_rows_formatter.rb', line 30 def example_failed(notification) output_row(type: :example_failed, example: JsonExample.new(notification.example).to_json) end |
#example_passed(notification) ⇒ Object
22 23 24 |
# File 'lib/turbo_tests/json_rows_formatter.rb', line 22 def example_passed(notification) output_row(type: :example_passed, example: JsonExample.new(notification.example).to_json) end |
#example_pending(notification) ⇒ Object
26 27 28 |
# File 'lib/turbo_tests/json_rows_formatter.rb', line 26 def example_pending(notification) output_row(type: :example_pending, example: JsonExample.new(notification.example).to_json) end |
#message(notification) ⇒ Object
42 43 44 |
# File 'lib/turbo_tests/json_rows_formatter.rb', line 42 def (notification) output_row(type: :message, message: notification.) end |
#seed(notification) ⇒ Object
34 35 36 |
# File 'lib/turbo_tests/json_rows_formatter.rb', line 34 def seed(notification) output_row(type: :seed, seed: notification.seed) end |