diff options
author | Go MAEDA <maeda@farend.jp> | 2019-05-25 06:50:25 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2019-05-25 06:50:25 +0000 |
commit | b0e17e8199bb40d0b1bed2c3dded355f439d8b3a (patch) | |
tree | 694b9ccde636af70a5aa515b62d1020a5eac9e62 /test/unit | |
parent | a12b7bcf2931045e63093adcd765d7c6e022fa05 (diff) | |
download | redmine-b0e17e8199bb40d0b1bed2c3dded355f439d8b3a.tar.gz redmine-b0e17e8199bb40d0b1bed2c3dded355f439d8b3a.zip |
Don't rescue Exception class (#31387).
Patch by Go MAEDA and Pavel Rosický.
git-svn-id: http://svn.redmine.org/redmine/trunk@18197 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/issue_nested_set_concurrency_test.rb | 2 | ||||
-rw-r--r-- | test/unit/mail_handler_test.rb | 2 | ||||
-rw-r--r-- | test/unit/mailer_test.rb | 6 | ||||
-rw-r--r-- | test/unit/project_nested_set_concurrency_test.rb | 2 | ||||
-rw-r--r-- | test/unit/tracker_test.rb | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/test/unit/issue_nested_set_concurrency_test.rb b/test/unit/issue_nested_set_concurrency_test.rb index 0a1c38bba..c31aae5b8 100644 --- a/test/unit/issue_nested_set_concurrency_test.rb +++ b/test/unit/issue_nested_set_concurrency_test.rb @@ -84,7 +84,7 @@ class IssueNestedSetConcurrencyTest < ActiveSupport::TestCase ActiveRecord::Base.connection_pool.with_connection do begin yield - rescue Exception => e + rescue => e Thread.current[:exception] = e.message end end diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb index 61b60434f..40de6bbbc 100644 --- a/test/unit/mail_handler_test.rb +++ b/test/unit/mail_handler_test.rb @@ -1223,7 +1223,7 @@ class MailHandlerTest < ActiveSupport::TestCase end def test_safe_receive_should_rescue_exceptions_and_return_false - MailHandler.stubs(:receive).raises(Exception.new "Something went wrong") + MailHandler.stubs(:receive).raises(StandardError.new "Something went wrong") assert_equal false, MailHandler.safe_receive end diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb index 75890baf3..ad04fbb90 100644 --- a/test/unit/mailer_test.rb +++ b/test/unit/mailer_test.rb @@ -920,10 +920,10 @@ class MailerTest < ActiveSupport::TestCase def test_should_raise_delivery_errors_when_raise_delivery_errors_is_true mail = Mailer.test_email(User.find(1)) - mail.delivery_method.stubs(:deliver!).raises(Exception.new("delivery error")) + mail.delivery_method.stubs(:deliver!).raises(StandardError.new("delivery error")) ActionMailer::Base.raise_delivery_errors = true - assert_raise Exception, "delivery error" do + assert_raise StandardError, "delivery error" do mail.deliver end ensure @@ -932,7 +932,7 @@ class MailerTest < ActiveSupport::TestCase def test_should_log_delivery_errors_when_raise_delivery_errors_is_false mail = Mailer.test_email(User.find(1)) - mail.delivery_method.stubs(:deliver!).raises(Exception.new("delivery error")) + mail.delivery_method.stubs(:deliver!).raises(StandardError.new("delivery error")) Rails.logger.expects(:error).with("Email delivery error: delivery error") ActionMailer::Base.raise_delivery_errors = false diff --git a/test/unit/project_nested_set_concurrency_test.rb b/test/unit/project_nested_set_concurrency_test.rb index 715faed0c..dbf936a75 100644 --- a/test/unit/project_nested_set_concurrency_test.rb +++ b/test/unit/project_nested_set_concurrency_test.rb @@ -52,7 +52,7 @@ class ProjectNestedSetConcurrencyTest < ActiveSupport::TestCase c2.reload.destroy c1.reload.destroy end - rescue Exception => e + rescue => e Thread.current[:exception] = e.message end end diff --git a/test/unit/tracker_test.rb b/test/unit/tracker_test.rb index 4cace7e3b..62ac35afb 100644 --- a/test/unit/tracker_test.rb +++ b/test/unit/tracker_test.rb @@ -129,7 +129,7 @@ class TrackerTest < ActiveSupport::TestCase tracker = Tracker.find(1) assert_no_difference 'Tracker.count' do - assert_raise Exception do + assert_raise StandardError do tracker.destroy end end |