1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add test for default silence and stderr deprecation behaviors

This commit is contained in:
Carlos Antonio da Silva 2012-04-28 18:22:11 -03:00
parent 9608395923
commit 34599c4f57

View file

@ -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 }