lib/active_support/testing/deprecation.rb in activesupport-2.3.18 vs lib/active_support/testing/deprecation.rb in activesupport-3.0.0.beta
- old
+ new
@@ -1,6 +1,6 @@
-require "active_support/core_ext/module"
+require 'active_support/deprecation'
module ActiveSupport
module Testing
module Deprecation #:nodoc:
def assert_deprecated(match = nil, &block)
@@ -35,23 +35,21 @@
end
end
begin
require 'test/unit/error'
-
+rescue LoadError
+ # Using miniunit, ignore.
+else
module Test
module Unit
- class Error # :nodoc:
+ class Error #:nodoc:
# Silence warnings when reporting test errors.
def message_with_silenced_deprecation
- ActiveSupport::Deprecation.silence do
- message_without_silenced_deprecation
- end
+ ActiveSupport::Deprecation.silence { message_without_silenced_deprecation }
end
-
- alias_method_chain :message, :silenced_deprecation
+ alias_method :message_without_silenced_deprecation, :message
+ alias_method :message, :message_with_silenced_deprecation
end
end
end
-rescue LoadError
- # Using miniunit, ignore.
end