diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2018-11-09 18:25:26 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2018-11-09 18:25:26 +0900 |
commit | 9bd5fc84ccaa59bd9ca8e81145e5ce15fbac75d2 (patch) | |
tree | 30db6ff47c6ecc195e960416a94bdd7b29bb5141 /railties | |
parent | b8b93f5c9b81be2687d6e0e9034adda0b2169afd (diff) | |
download | rails-9bd5fc84ccaa59bd9ca8e81145e5ce15fbac75d2.tar.gz rails-9bd5fc84ccaa59bd9ca8e81145e5ce15fbac75d2.tar.bz2 rails-9bd5fc84ccaa59bd9ca8e81145e5ce15fbac75d2.zip |
Add test for parallel tests with unmarshable exception
Follow up #34131.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/application/test_runner_test.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/railties/test/application/test_runner_test.rb b/railties/test/application/test_runner_test.rb index 5c34b205c9..0046fec062 100644 --- a/railties/test/application/test_runner_test.rb +++ b/railties/test/application/test_runner_test.rb @@ -562,6 +562,30 @@ module ApplicationTests assert_no_match "create_table(:users)", output end + def test_run_in_parallel_with_unmarshable_exception + file = app_file "test/fail_test.rb", <<-RUBY + require "test_helper" + class FailTest < ActiveSupport::TestCase + class BadError < StandardError + def initialize + super + @proc = ->{ } + end + end + + test "fail" do + raise BadError + assert true + end + end + RUBY + + output = run_test_command(file) + + assert_match "DRb::DRbRemoteError: FailTest::BadError", output + assert_match "1 runs, 0 assertions, 0 failures, 1 errors", output + end + def test_raise_error_when_specified_file_does_not_exist error = capture(:stderr) { run_test_command("test/not_exists.rb", stderr: true) } assert_match(%r{cannot load such file.+test/not_exists\.rb}, error) |