From 07e422f58d61da0da4fce3180c3b79982e208143 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Mon, 15 Feb 2016 15:09:00 +0100 Subject: test runner, relay minitest information about the error location. This is a follow-up to ea70c29 to bring back the assertion error location information provided by minitest. --- railties/lib/rails/test_unit/reporter.rb | 2 +- railties/test/application/test_runner_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/railties/lib/rails/test_unit/reporter.rb b/railties/lib/rails/test_unit/reporter.rb index 317726f672..ce99dbd585 100644 --- a/railties/lib/rails/test_unit/reporter.rb +++ b/railties/lib/rails/test_unit/reporter.rb @@ -68,7 +68,7 @@ module Rails def format_failures(result) result.failures.map do |failure| - "#{failure.result_label}:\n#{result.class}##{result.name}:\n#{failure.message}\n" + "#{failure.result_label}:\n#{result.location}:\n#{failure.message}\n" end end diff --git a/railties/test/application/test_runner_test.rb b/railties/test/application/test_runner_test.rb index 5a6119c483..b0f348f3f1 100644 --- a/railties/test/application/test_runner_test.rb +++ b/railties/test/application/test_runner_test.rb @@ -467,7 +467,7 @@ module ApplicationTests create_test_file :models, 'post', pass: false output = run_test_command('test/models/post_test.rb') - expect = %r{Running:\n\nPostTest\nF\n\nFailure:\nPostTest#test_truth:\nwups!\n\nbin/rails test test/models/post_test.rb:4\n\n\n\n} + expect = %r{Running:\n\nPostTest\nF\n\nFailure:\nPostTest#test_truth \[[^\]]+test/models/post_test.rb:6\]:\nwups!\n\nbin/rails test test/models/post_test.rb:4\n\n\n\n} assert_match expect, output end -- cgit v1.2.3