Class: RSpec::Risky::JsonEventFormatter
- Inherits:
-
Object
- Object
- RSpec::Risky::JsonEventFormatter
- Defined in:
- lib/rspec/risky/json_event_formatter.rb,
sig/rspec/risky.rbs
Instance Method Summary collapse
- #example_finished(notification) ⇒ Object
-
#initialize(output) ⇒ JsonEventFormatter
constructor
A new instance of JsonEventFormatter.
Constructor Details
#initialize(output) ⇒ JsonEventFormatter
Returns a new instance of JsonEventFormatter.
11 12 13 |
# File 'lib/rspec/risky/json_event_formatter.rb', line 11 def initialize(output) @output = output end |
Instance Method Details
#example_finished(notification) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/rspec/risky/json_event_formatter.rb', line 15 def example_finished(notification) result = notification.example.[:rspec_risky] return unless result result[:verdicts].each do |verdict| @output.write(JSON.generate(event_payload(notification.example, result, verdict))) @output.write("\n") end end |