aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/deprecation.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/deprecation.rb')
-rw-r--r--activesupport/lib/active_support/deprecation.rb33
1 files changed, 20 insertions, 13 deletions
diff --git a/activesupport/lib/active_support/deprecation.rb b/activesupport/lib/active_support/deprecation.rb
index b4d8f61b8c..b3ad599371 100644
--- a/activesupport/lib/active_support/deprecation.rb
+++ b/activesupport/lib/active_support/deprecation.rb
@@ -221,23 +221,30 @@ class Module
include ActiveSupport::Deprecation::ClassMethods
end
-require 'test/unit/error'
-module Test
- module Unit
- class TestCase
- include ActiveSupport::Deprecation::Assertions
- end
+require 'active_support/test_case'
+
+class ActiveSupport::TestCase
+ include ActiveSupport::Deprecation::Assertions
+end
+
+begin
+ require 'test/unit/error'
- class Error # :nodoc:
- # Silence warnings when reporting test errors.
- def message_with_silenced_deprecation
- ActiveSupport::Deprecation.silence do
- message_without_silenced_deprecation
+ module Test
+ module Unit
+ class Error # :nodoc:
+ # Silence warnings when reporting test errors.
+ def message_with_silenced_deprecation
+ ActiveSupport::Deprecation.silence do
+ message_without_silenced_deprecation
+ end
end
- end
- alias_method_chain :message, :silenced_deprecation
+ alias_method_chain :message, :silenced_deprecation
+ end
end
end
+rescue LoadError
+ # Using miniunit, ignore.
end