aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/deprecation_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-12-17 08:21:45 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-12-17 08:21:45 +0000
commit8a73d4fe6f2e22f0f9c6a99305357b00bf1ba86f (patch)
treedbc063c06c3f55241f9cc799110f4796e6a66d43 /activesupport/test/deprecation_test.rb
parent2570f408f0326bf9c7a9cbae55e0ccf909b8c820 (diff)
downloadrails-8a73d4fe6f2e22f0f9c6a99305357b00bf1ba86f.tar.gz
rails-8a73d4fe6f2e22f0f9c6a99305357b00bf1ba86f.tar.bz2
rails-8a73d4fe6f2e22f0f9c6a99305357b00bf1ba86f.zip
Deprecation: silence warnings when reporting test errors.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5728 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/deprecation_test.rb')
-rw-r--r--activesupport/test/deprecation_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/activesupport/test/deprecation_test.rb b/activesupport/test/deprecation_test.rb
index 21baa11a80..5699ef78d6 100644
--- a/activesupport/test/deprecation_test.rb
+++ b/activesupport/test/deprecation_test.rb
@@ -128,4 +128,20 @@ class DeprecationTest < Test::Unit::TestCase
def test_deprecation_with_explicit_message
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
+ end
+ end
+
+ 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
+ end
end