Class: Minitest::ProfileReporter
- Inherits:
-
Reporter
- Object
- Reporter
- Minitest::ProfileReporter
- Defined in:
- lib/minitest/rails_plugin.rb
Instance Attribute Summary collapse
-
#results ⇒ Object
Returns the value of attribute results.
Instance Method Summary collapse
-
#initialize(io = $stdout, options = {}) ⇒ ProfileReporter
constructor
A new instance of ProfileReporter.
- #passed? ⇒ Boolean
- #record(result) ⇒ Object
- #report ⇒ Object
- #summary ⇒ Object
Constructor Details
#initialize(io = $stdout, options = {}) ⇒ ProfileReporter
Returns a new instance of ProfileReporter.
31 32 33 34 35 |
# File 'lib/minitest/rails_plugin.rb', line 31 def initialize(io = $stdout, = {}) super @results = [] @count = [:profile] end |
Instance Attribute Details
#results ⇒ Object
Returns the value of attribute results.
29 30 31 |
# File 'lib/minitest/rails_plugin.rb', line 29 def results @results end |
Instance Method Details
#passed? ⇒ Boolean
50 51 52 |
# File 'lib/minitest/rails_plugin.rb', line 50 def passed? true end |
#record(result) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/minitest/rails_plugin.rb', line 37 def record(result) if output_file = ENV["RAILTIES_OUTPUT_FILE"] File.open(output_file, "a") do |f| # Round-trip for re-serialization data = JSON.parse(result.to_json) data[:location] = result.location f.puts(data.to_json) end else @results << result end end |
#report ⇒ Object
54 55 56 57 58 |
# File 'lib/minitest/rails_plugin.rb', line 54 def report # Skip if we're outputting to a file return if ENV["RAILTIES_OUTPUT_FILE"] print_summary end |
#summary ⇒ Object
60 61 62 |
# File 'lib/minitest/rails_plugin.rb', line 60 def summary print_summary end |