aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/deprecation_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/deprecation_test.rb')
-rw-r--r--activesupport/test/deprecation_test.rb26
1 files changed, 14 insertions, 12 deletions
diff --git a/activesupport/test/deprecation_test.rb b/activesupport/test/deprecation_test.rb
index 27e9573ce2..73a1f9959c 100644
--- a/activesupport/test/deprecation_test.rb
+++ b/activesupport/test/deprecation_test.rb
@@ -32,7 +32,7 @@ class Deprecatee
end
-class DeprecationTest < Test::Unit::TestCase
+class DeprecationTest < ActiveSupport::TestCase
def setup
# Track the last warning.
@old_behavior = ActiveSupport::Deprecation.behavior
@@ -143,19 +143,21 @@ class DeprecationTest < Test::Unit::TestCase
assert_deprecated(/you now need to do something extra for this one/) { @dtc.d }
end
- def test_assertion_failed_error_doesnt_spout_deprecation_warnings
- error_class = Class.new(StandardError) do
- def message
- ActiveSupport::Deprecation.warn 'warning in error message'
- super
+ unless defined?(::MiniTest)
+ def test_assertion_failed_error_doesnt_spout_deprecation_warnings
+ error_class = Class.new(StandardError) do
+ def message
+ ActiveSupport::Deprecation.warn 'warning in error message'
+ super
+ end
end
- end
- raise error_class.new('hmm')
+ raise error_class.new('hmm')
- rescue => e
- error = Test::Unit::Error.new('testing ur doodz', e)
- assert_not_deprecated { error.message }
- assert_nil @last_message
+ rescue => e
+ error = Test::Unit::Error.new('testing ur doodz', e)
+ assert_not_deprecated { error.message }
+ assert_nil @last_message
+ end
end
end