diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2015-12-19 20:04:39 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2015-12-21 07:48:53 +0900 |
commit | 4f8c36ab707b7a262cd9b37d4a71e6234d9f8f3c (patch) | |
tree | f2d24490f398647a42547244fbf766f82f8af08e /railties/test/test_unit | |
parent | 6873db4699ac727dd27eedb0994ecdd976b40901 (diff) | |
download | rails-4f8c36ab707b7a262cd9b37d4a71e6234d9f8f3c.tar.gz rails-4f8c36ab707b7a262cd9b37d4a71e6234d9f8f3c.tar.bz2 rails-4f8c36ab707b7a262cd9b37d4a71e6234d9f8f3c.zip |
display detailed information in inline reporting
The errors message only was not displayed, as if it did not use the inline reporting,
modified to also information the method name and the like in error are displayed.
```
# before
Failed assertion, no message given.
bin/rails test test/models/user_test.rb:5
```
```
# after
Failure:
UserTest#test_the_truth:
Failed assertion, no message given.
bin/rails test test/models/user_test.rb:5
```
Diffstat (limited to 'railties/test/test_unit')
-rw-r--r-- | railties/test/test_unit/reporter_test.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/railties/test/test_unit/reporter_test.rb b/railties/test/test_unit/reporter_test.rb index e517d8dd0b..3ff7cd18cd 100644 --- a/railties/test/test_unit/reporter_test.rb +++ b/railties/test/test_unit/reporter_test.rb @@ -61,14 +61,16 @@ class TestUnitReporterTest < ActiveSupport::TestCase @reporter.record(failed_test) @reporter.report - assert_match %r{\A\n\nboo\n\nbin/rails test .*test/test_unit/reporter_test.rb:\d+\n\n\z}, @output.string + expect = %r{\A\n\nFailure:\nTestUnitReporterTest::ExampleTest#woot:\nboo\n\nbin/rails test test/test_unit/reporter_test.rb:\d+\n\n\z} + assert_match expect, @output.string end test "outputs errors inline" do @reporter.record(errored_test) @reporter.report - assert_match %r{\A\n\nArgumentError: wups\n No backtrace\n\nbin/rails test .*test/test_unit/reporter_test.rb:6\n\n\z}, @output.string + expect = %r{\A\n\nError:\nTestUnitReporterTest::ExampleTest#woot:\nArgumentError: wups\n No backtrace\n\nbin/rails test .*test/test_unit/reporter_test.rb:6\n\n\z} + assert_match expect, @output.string end test "outputs skipped tests inline if verbose" do @@ -76,7 +78,8 @@ class TestUnitReporterTest < ActiveSupport::TestCase verbose.record(skipped_test) verbose.report - assert_match %r{\A\n\nskipchurches, misstemples\n\nbin/rails test .*test/test_unit/reporter_test.rb:\d+\n\n\z}, @output.string + expect = %r{\A\n\nSkipped:\nTestUnitReporterTest::ExampleTest#woot:\nskipchurches, misstemples\n\nbin/rails test test/test_unit/reporter_test.rb:\d+\n\n\z} + assert_match expect, @output.string end test "does not output rerun snippets after run" do |