diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-02-15 17:01:29 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-02-17 22:04:32 +0900 |
commit | 1b8fc04216099836a05a2cdfa334a28a8687251c (patch) | |
tree | 2b223637fa026ec694a5404808f0387c55b6f54c /railties/test | |
parent | c60fb74dc6ea373bfe3d04731a2d2b6ba641f850 (diff) | |
download | rails-1b8fc04216099836a05a2cdfa334a28a8687251c.tar.gz rails-1b8fc04216099836a05a2cdfa334a28a8687251c.tar.bz2 rails-1b8fc04216099836a05a2cdfa334a28a8687251c.zip |
modify to `error` also abort when specify fail fast option
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/test_unit/reporter_test.rb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/railties/test/test_unit/reporter_test.rb b/railties/test/test_unit/reporter_test.rb index 7dad2b7779..0d64b48550 100644 --- a/railties/test/test_unit/reporter_test.rb +++ b/railties/test/test_unit/reporter_test.rb @@ -104,11 +104,22 @@ class TestUnitReporterTest < ActiveSupport::TestCase end end - test "fail fast does not interrupt run errors or skips" do + test "fail fast interrupts run on error" do fail_fast = Rails::TestUnitReporter.new @output, fail_fast: true + interrupt_raised = false - fail_fast.record(errored_test) - assert_no_match 'Failed tests:', @output.string + # Minitest passes through Interrupt, catch it manually. + begin + fail_fast.record(errored_test) + rescue Interrupt + interrupt_raised = true + ensure + assert interrupt_raised, 'Expected Interrupt to be raised.' + end + end + + test "fail fast does not interrupt run skips" do + fail_fast = Rails::TestUnitReporter.new @output, fail_fast: true fail_fast.record(skipped_test) assert_no_match 'Failed tests:', @output.string |