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.
113 114 115 116 117 118 |
# File 'lib/inspec/rspec_json_formatter.rb', line 113 def initialize(*args) super(*args) @profiles = [] @profiles_info = nil @backend = nil end |
Instance Attribute Details
#backend=(value) ⇒ Object (writeonly)
Sets the attribute backend
111 112 113 |
# File 'lib/inspec/rspec_json_formatter.rb', line 111 def backend=(value) @backend = value end |
Instance Method Details
#add_profile(profile) ⇒ Object
Called by the runner during example collection.
121 122 123 |
# File 'lib/inspec/rspec_json_formatter.rb', line 121 def add_profile(profile) @profiles.push(profile) end |
#stop(notification) ⇒ Object
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/inspec/rspec_json_formatter.rb', line 125 def stop(notification) super(notification) @output_hash[:other_checks] = examples_without_controls @output_hash[:profiles] = profiles_info @output_hash[:platform] = { name: os(:name), release: os(:release), } examples_with_controls.each do |example| control = example2control(example) move_example_into_control(example, control) end end |