aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-09-04 02:57:40 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-09-04 02:57:40 +0000
commit23d579b262e6f665d8d343d066aa7fd640ce46b4 (patch)
tree0582bc071ed77bdc63b4d1e4a691a504b493ac05 /activesupport
parent7466c1125c907ad9b9391331809c749ccb3d1c78 (diff)
downloadrails-23d579b262e6f665d8d343d066aa7fd640ce46b4.tar.gz
rails-23d579b262e6f665d8d343d066aa7fd640ce46b4.tar.bz2
rails-23d579b262e6f665d8d343d066aa7fd640ce46b4.zip
Quiet while testing, you.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4961 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/deprecation.rb3
-rw-r--r--activesupport/test/deprecation_test.rb9
2 files changed, 5 insertions, 7 deletions
diff --git a/activesupport/lib/active_support/deprecation.rb b/activesupport/lib/active_support/deprecation.rb
index c61dd73076..2cfbfcc21a 100644
--- a/activesupport/lib/active_support/deprecation.rb
+++ b/activesupport/lib/active_support/deprecation.rb
@@ -87,10 +87,9 @@ module ActiveSupport
deprecations = []
ActiveSupport::Deprecation.behavior = Proc.new do |message|
deprecations << message
- old_behavior.call(message) if old_behavior
end
yield
- return deprecations
+ deprecations
ensure
ActiveSupport::Deprecation.behavior = old_behavior
end
diff --git a/activesupport/test/deprecation_test.rb b/activesupport/test/deprecation_test.rb
index 75a0d38f5b..cda45c6a9f 100644
--- a/activesupport/test/deprecation_test.rb
+++ b/activesupport/test/deprecation_test.rb
@@ -39,7 +39,7 @@ class DeprecationTest < Test::Unit::TestCase
@dtc.partially
end
end
-
+
def test_undeprecated
assert_not_deprecated do
assert_equal 2, @dtc.not
@@ -67,21 +67,20 @@ class DeprecationTest < Test::Unit::TestCase
def test_deprecated_instance_variable_proxy
assert_not_deprecated { @dtc.request.size }
-
+
assert_deprecated('@request.size') { assert_equal @dtc.request.size, @dtc.old_request.size }
assert_deprecated('@request.to_s') { assert_equal @dtc.request.to_s, @dtc.old_request.to_s }
end
-
+
def test_assert_deprecation_without_match
assert_deprecated do
@dtc.partially
end
end
-
+
def test_silence
ActiveSupport::Deprecation.silence do
assert_not_deprecated { @dtc.partially }
end
end
-
end