aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/deprecation_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-09-15 05:54:18 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-09-15 05:54:18 +0000
commitd0c000ab9e90be4896744cb6ec107dffa573f2dd (patch)
treed5cb7431dd4621864fe184a76dd19b5fce0c3047 /activesupport/test/deprecation_test.rb
parent069b0eaf0bd42a2474028022b1e907dc97cc2e41 (diff)
downloadrails-d0c000ab9e90be4896744cb6ec107dffa573f2dd.tar.gz
rails-d0c000ab9e90be4896744cb6ec107dffa573f2dd.tar.bz2
rails-d0c000ab9e90be4896744cb6ec107dffa573f2dd.zip
assert_deprecated returns result of block
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5115 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/deprecation_test.rb')
-rw-r--r--activesupport/test/deprecation_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/test/deprecation_test.rb b/activesupport/test/deprecation_test.rb
index a7d833f49d..bbcee24f5c 100644
--- a/activesupport/test/deprecation_test.rb
+++ b/activesupport/test/deprecation_test.rb
@@ -87,6 +87,18 @@ class DeprecationTest < Test::Unit::TestCase
flunk 'assert_deprecated should match any warning in block, not just the last one'
end
+ def test_assert_not_deprecated_returns_result_of_block
+ assert_equal 123, assert_not_deprecated { 123 }
+ end
+
+ def test_assert_deprecated_returns_result_of_block
+ result = assert_deprecated('abc') do
+ ActiveSupport::Deprecation.warn 'abc'
+ 123
+ end
+ assert_equal 123, result
+ end
+
def test_silence
ActiveSupport::Deprecation.silence do
assert_not_deprecated { @dtc.partially }