class Minitest::LineReporter
def initialize(*)
def initialize(*) super @failures = [] end
def record(result)
def record(result) if !result.skipped? && !result.passed? @failures << result end end
def report
def report return unless @failures.any? io.puts io.puts "Focus on failing tests:" pwd = Pathname.new(Dir.pwd) @failures.each do |res| meth = res.method(res.name) file, line = meth.source_location if file file = Pathname.new(file) file = file.relative_path_from(pwd) if file.absolute? output = "ruby #{file} -l #{line}" output = "\e[31m#{output}\e[0m" if $stdout.tty? io.puts output end end end