aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/deprecation.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-06-10 14:01:05 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2008-11-07 01:16:06 -0500
commit7b28a55a2bc9bedd5a8c8dec0a8a02166927ef16 (patch)
treec1378f3c30fbff6ae623f148aa109e2ee956fc9e /activesupport/lib/active_support/deprecation.rb
parent983dc8078708fff5d99fc31eb5eac8b532e950b3 (diff)
downloadrails-7b28a55a2bc9bedd5a8c8dec0a8a02166927ef16.tar.gz
rails-7b28a55a2bc9bedd5a8c8dec0a8a02166927ef16.tar.bz2
rails-7b28a55a2bc9bedd5a8c8dec0a8a02166927ef16.zip
Remove direct TestCase mixins. Add miniunit compatibility.
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