Class: Minitest::Metz::StatsReporter
- Inherits:
-
Reporter
- Object
- Reporter
- Minitest::Metz::StatsReporter
- Defined in:
- lib/minitest/metz/stats_reporter.rb
Instance Method Summary collapse
-
#initialize ⇒ StatsReporter
constructor
A new instance of StatsReporter.
- #record(result) ⇒ Object
- #report ⇒ Object
Constructor Details
#initialize ⇒ StatsReporter
Returns a new instance of StatsReporter.
7 8 9 10 |
# File 'lib/minitest/metz/stats_reporter.rb', line 7 def initialize @scanner = Minitest::Metz::Scanner.new @results = {} end |
Instance Method Details
#record(result) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/minitest/metz/stats_reporter.rb', line 12 def record(result) file_path, = result.class.instance_method(result.name).source_location unless @results[file_path] scan_result = Minitest::Metz::Scanner.scan(file_path) @results[file_path] = build_results_string(file_path, scan_result) end end |
#report ⇒ Object
20 21 22 23 24 |
# File 'lib/minitest/metz/stats_reporter.rb', line 20 def report @results.each do |key, output| puts output end end |