summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/admin_controller_test.rb4
-rw-r--r--test/test_helper.rb2
-rw-r--r--test/unit/issue_nested_set_concurrency_test.rb2
-rw-r--r--test/unit/mail_handler_test.rb2
-rw-r--r--test/unit/mailer_test.rb6
-rw-r--r--test/unit/project_nested_set_concurrency_test.rb2
-rw-r--r--test/unit/tracker_test.rb2
7 files changed, 10 insertions, 10 deletions
diff --git a/test/functional/admin_controller_test.rb b/test/functional/admin_controller_test.rb
index 6d951f68f..e2bc2f9f0 100644
--- a/test/functional/admin_controller_test.rb
+++ b/test/functional/admin_controller_test.rb
@@ -75,7 +75,7 @@ class AdminControllerTest < Redmine::ControllerTest
def test_load_default_configuration_data_should_rescue_error
delete_configuration_data
- Redmine::DefaultData::Loader.stubs(:load).raises(Exception.new("Something went wrong"))
+ Redmine::DefaultData::Loader.stubs(:load).raises(StandardError.new("Something went wrong"))
post :default_configuration, :params => {
:lang => 'fr'
}
@@ -99,7 +99,7 @@ class AdminControllerTest < Redmine::ControllerTest
end
def test_test_email_failure_should_display_the_error
- Mailer.stubs(:test_email).raises(Exception, 'Some error message')
+ Mailer.stubs(:test_email).raises(StandardError, 'Some error message')
post :test_email
assert_redirected_to '/settings?tab=notifications'
assert_match /Some error message/, flash[:error]
diff --git a/test/test_helper.rb b/test/test_helper.rb
index c9f6320bc..868f6badf 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -121,7 +121,7 @@ class ActiveSupport::TestCase
def self.ldap_configured?
@test_ldap = Net::LDAP.new(:host => $redmine_test_ldap_server, :port => 389)
return @test_ldap.bind
- rescue Exception => e
+ rescue => e
# LDAP is not listening
return nil
end
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