diff options
author | Arthur Neves <arthurnn@gmail.com> | 2015-01-23 22:57:52 -0500 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-03-18 09:52:17 +0100 |
commit | ccee7eea8e5a8a34256467dd1096ac549dd17362 (patch) | |
tree | 2f6810e0624303bbce3e245297378ae62e569806 | |
parent | a71bcdb4f3ab25594955277fa7a7c49c84cd0925 (diff) | |
download | rails-ccee7eea8e5a8a34256467dd1096ac549dd17362.tar.gz rails-ccee7eea8e5a8a34256467dd1096ac549dd17362.tar.bz2 rails-ccee7eea8e5a8a34256467dd1096ac549dd17362.zip |
Show the right file when test raises
-rw-r--r-- | railties/lib/rails/test_unit/reporter.rb | 7 | ||||
-rw-r--r-- | railties/test/application/test_test.rb | 1 |
2 files changed, 4 insertions, 4 deletions
diff --git a/railties/lib/rails/test_unit/reporter.rb b/railties/lib/rails/test_unit/reporter.rb index 6d33fae911..e82c4e653c 100644 --- a/railties/lib/rails/test_unit/reporter.rb +++ b/railties/lib/rails/test_unit/reporter.rb @@ -14,10 +14,9 @@ module Rails 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 diff --git a/railties/test/application/test_test.rb b/railties/test/application/test_test.rb index c7132837b1..58b1bdbe86 100644 --- a/railties/test/application/test_test.rb +++ b/railties/test/application/test_test.rb @@ -65,6 +65,7 @@ module ApplicationTests 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 |