blob: bfdc9754d4472671ed9212d66b5b6f499f7471ab (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
require "minitest"
module Rails
class TestUnitReporter < Minitest::StatisticsReporter
def report
return if results.empty?
io.puts
io.puts "Failed tests:"
io.puts
io.puts aggregated_results
end
def aggregated_results # :nodoc:
filtered_results = results.dup
filtered_results.reject!(&:skipped?) unless options[:verbose]
filtered_results.map do |result|
location, line = result.method(result.name).source_location
"bin/rails test #{relative_path_for(location)}:#{line}"
end.join "\n"
end
def relative_path_for(file)
file.sub(/^#{Rails.root}\/?/, '')
end
end
end
|