diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-04-28 18:22:11 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-04-28 18:25:35 -0300 |
commit | 34599c4f57121bf693886b39f9a9724d41998514 (patch) | |
tree | 76c066289e13b19d23a435d21098f28c03c298eb | |
parent | 9608395923899e3f91e0d07ac2ed52efc17bcc40 (diff) | |
download | rails-34599c4f57121bf693886b39f9a9724d41998514.tar.gz rails-34599c4f57121bf693886b39f9a9724d41998514.tar.bz2 rails-34599c4f57121bf693886b39f9a9724d41998514.zip |
Add test for default silence and stderr deprecation behaviors
-rw-r--r-- | activesupport/test/deprecation_test.rb | 20 |
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 } |