Show the right file when test raises
This commit is contained in:
parent
a71bcdb4f3
commit
ccee7eea8e
@ -14,10 +14,9 @@ def aggregated_results # :nodoc:
|
||||
filtered_results = results.dup
|
||||
filtered_results.reject!(&:skipped?) unless options[:verbose]
|
||||
filtered_results.map do |result|
|
||||
result.failures.map { |failure|
|
||||
"bin/rails test #{failure.location}\n"
|
||||
}.join "\n"
|
||||
end.join
|
||||
location, line = result.method(result.name).source_location
|
||||
"bin/rails test #{location}:#{line}"
|
||||
end.join "\n"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -65,6 +65,7 @@ def test_failure
|
||||
|
||||
output = run_test_file('unit/failing_test.rb', env: { "BACKTRACE" => "1" })
|
||||
assert_match %r{/app/test/unit/failing_test\.rb}, output
|
||||
assert_match %r{/app/test/unit/failing_test\.rb:4}, output
|
||||
end
|
||||
|
||||
test "ruby schema migrations" do
|
||||
|
Loading…
Reference in New Issue
Block a user