Class: RSpec::RfcHelper::JsonRenderer
- Inherits:
-
Object
- Object
- RSpec::RfcHelper::JsonRenderer
- Defined in:
- lib/rspec/rfc_helper/json_renderer.rb
Overview
Markdown renderer for specs
Instance Method Summary collapse
-
#initialize(specs) ⇒ JsonRenderer
constructor
A new instance of JsonRenderer.
-
#render ⇒ String
Generates a report in JSON format.
Constructor Details
#initialize(specs) ⇒ JsonRenderer
Returns a new instance of JsonRenderer.
10 11 12 |
# File 'lib/rspec/rfc_helper/json_renderer.rb', line 10 def initialize(specs) @specs = specs end |
Instance Method Details
#render ⇒ String
Generates a report in JSON format.
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rspec/rfc_helper/json_renderer.rb', line 18 def render json = { name: @specs.name, url: @specs.specs_url, specs: specs, sections: sections, } JSON.pretty_generate json end |