Class: Minitest::LineReporter
- Inherits:
-
Reporter
- Object
- Reporter
- Minitest::LineReporter
- Defined in:
- lib/minitest/line_plugin.rb
Instance Method Summary collapse
-
#initialize ⇒ LineReporter
constructor
A new instance of LineReporter.
- #record(result) ⇒ Object
- #report ⇒ Object
Constructor Details
#initialize ⇒ LineReporter
Returns a new instance of LineReporter.
41 42 43 44 |
# File 'lib/minitest/line_plugin.rb', line 41 def initialize(*) super @failures = [] end |
Instance Method Details
#record(result) ⇒ Object
46 47 48 49 50 |
# File 'lib/minitest/line_plugin.rb', line 46 def record(result) if !result.skipped? && !result.passed? @failures << result end end |
#report ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/minitest/line_plugin.rb', line 52 def report return unless @failures.any? io.puts io.puts "Focus on failing tests:" @failures.each do |res| meth = res.method(res.name) file, line = meth.source_location if file io.puts "$ ruby #{file} -l #{line}" end end end |