diff options
author | Hongli Lai (Phusion) <hongli@phusion.nl> | 2008-12-03 19:30:35 +0100 |
---|---|---|
committer | Hongli Lai (Phusion) <hongli@phusion.nl> | 2008-12-03 19:30:35 +0100 |
commit | ccb96f2297e8783165cba764e9b5d51e1a15ff87 (patch) | |
tree | 3229e6fdddc42054615514d843c555e341003033 /activesupport/test/deprecation_test.rb | |
parent | fb2325e35855d62abd2c76ce03feaa3ca7992e4f (diff) | |
parent | 761a633a9c0a45d76ef3ed10da97e3696c3ded79 (diff) | |
download | rails-ccb96f2297e8783165cba764e9b5d51e1a15ff87.tar.gz rails-ccb96f2297e8783165cba764e9b5d51e1a15ff87.tar.bz2 rails-ccb96f2297e8783165cba764e9b5d51e1a15ff87.zip |
Merge commit 'origin/master' into savepoints
Conflicts:
activerecord/lib/active_record/fixtures.rb
activerecord/test/cases/defaults_test.rb
Diffstat (limited to 'activesupport/test/deprecation_test.rb')
-rw-r--r-- | activesupport/test/deprecation_test.rb | 26 |
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 |