Class: RSpec::Signal::Reporters::JsonReport

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/signal/reporters/json_report.rb

Overview

Machine-readable twin of the Markdown report, for tooling and CI.

Instance Method Summary collapse

Constructor Details

#initialize(report, _config = nil) ⇒ JsonReport

Returns a new instance of JsonReport.



10
11
12
# File 'lib/rspec/signal/reporters/json_report.rb', line 10

def initialize(report, _config = nil)
  @report = report
end

Instance Method Details

#renderObject



14
15
16
# File 'lib/rspec/signal/reporters/json_report.rb', line 14

def render
  "#{JSON.pretty_generate(@report.to_h)}\n"
end