Class: Minitest::Reporters::JsonReporter
- Inherits:
-
BaseReporter
- Object
- BaseReporter
- Minitest::Reporters::JsonReporter
- Defined in:
- lib/minitest/reporters/json_reporter.rb,
lib/minitest/reporters/json_reporter/version.rb
Overview
Minitest Reporter that produces a JSON output for interface in IDEs, editor.
Constant Summary collapse
- VERSION =
Version of the Minitest::Reporters::JsonReporter gem.
'1.0.0'.freeze
Instance Attribute Summary collapse
-
#storage ⇒ Object
Hash that represents the final elements prior to being converted to JSON.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ JsonReporter
constructor
Constructor for Minitest::Reporters::JsonReporter Takes possible options.
-
#report ⇒ Object
Called by runner to report the conclusion of the test run Converts result of to_h to JSON and calls io.write to output it.
Constructor Details
#initialize(options = {}) ⇒ JsonReporter
Constructor for Minitest::Reporters::JsonReporter Takes possible options. E.g. :verbose => true
21 22 23 |
# File 'lib/minitest/reporters/json_reporter.rb', line 21 def initialize( = {}) super end |
Instance Attribute Details
#storage ⇒ Object
Hash that represents the final elements prior to being converted to JSON
27 28 29 |
# File 'lib/minitest/reporters/json_reporter.rb', line 27 def storage @storage end |
Instance Method Details
#report ⇒ Object
Called by runner to report the conclusion of the test run Converts result of to_h to JSON and calls io.write to output it.
32 33 34 35 36 37 38 |
# File 'lib/minitest/reporters/json_reporter.rb', line 32 def report super @storage = to_h # formate @storage as JSON and write to output stream io.write(JSON.dump(@storage)) end |