Class: InspecRspecJson
- Inherits:
-
InspecRspecMiniJson
- Object
- RSpec::Core::Formatters::JsonFormatter
- InspecRspecMiniJson
- InspecRspecJson
- Defined in:
- lib/inspec/rspec_json_formatter.rb
Overview
rubocop:disable Metrics/ClassLength
Direct Known Subclasses
Instance Attribute Summary collapse
-
#backend ⇒ Object
writeonly
Sets the attribute backend.
Instance Method Summary collapse
-
#add_profile(profile) ⇒ Object
Called by the runner during example collection.
-
#initialize(*args) ⇒ InspecRspecJson
constructor
A new instance of InspecRspecJson.
- #stop(notification) ⇒ Object
Methods inherited from InspecRspecMiniJson
Constructor Details
#initialize(*args) ⇒ InspecRspecJson
Returns a new instance of InspecRspecJson.
100 101 102 103 104 105 |
# File 'lib/inspec/rspec_json_formatter.rb', line 100 def initialize(*args) super(*args) @profiles = [] @profiles_info = nil @backend = nil end |
Instance Attribute Details
#backend=(value) ⇒ Object (writeonly)
Sets the attribute backend
98 99 100 |
# File 'lib/inspec/rspec_json_formatter.rb', line 98 def backend=(value) @backend = value end |
Instance Method Details
#add_profile(profile) ⇒ Object
Called by the runner during example collection.
108 109 110 |
# File 'lib/inspec/rspec_json_formatter.rb', line 108 def add_profile(profile) @profiles.push(profile) end |
#stop(notification) ⇒ Object
112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/inspec/rspec_json_formatter.rb', line 112 def stop(notification) super(notification) @output_hash[:other_checks] = examples_without_controls @output_hash[:profiles] = profiles_info examples_with_controls.each do |example| control = example2control(example) move_example_into_control(example, control) end end |