aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/deprecation_test.rb
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-04-28 18:22:11 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-04-28 18:25:35 -0300
commit34599c4f57121bf693886b39f9a9724d41998514 (patch)
tree76c066289e13b19d23a435d21098f28c03c298eb /activesupport/test/deprecation_test.rb
parent9608395923899e3f91e0d07ac2ed52efc17bcc40 (diff)
downloadrails-34599c4f57121bf693886b39f9a9724d41998514.tar.gz
rails-34599c4f57121bf693886b39f9a9724d41998514.tar.bz2
rails-34599c4f57121bf693886b39f9a9724d41998514.zip
Add test for default silence and stderr deprecation behaviors
Diffstat (limited to 'activesupport/test/deprecation_test.rb')
-rw-r--r--activesupport/test/deprecation_test.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/activesupport/test/deprecation_test.rb b/activesupport/test/deprecation_test.rb
index e821a285d7..e21f3efe36 100644
--- a/activesupport/test/deprecation_test.rb
+++ b/activesupport/test/deprecation_test.rb
@@ -93,6 +93,26 @@ class DeprecationTest < ActiveSupport::TestCase
assert_match(/foo=nil/, @b)
end
+ def test_default_stderr_behavior
+ ActiveSupport::Deprecation.behavior = :stderr
+ behavior = ActiveSupport::Deprecation.behavior.first
+
+ content = capture(:stderr) {
+ assert_nil behavior.call('Some error!', ['call stack!'])
+ }
+ assert_match(/Some error!/, content)
+ assert_match(/call stack!/, content)
+ end
+
+ def test_default_silence_behavior
+ ActiveSupport::Deprecation.behavior = :silence
+ behavior = ActiveSupport::Deprecation.behavior.first
+
+ assert_blank capture(:stderr) {
+ assert_nil behavior.call('Some error!', ['call stack!'])
+ }
+ end
+
def test_deprecated_instance_variable_proxy
assert_not_deprecated { @dtc.request.size }