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:
parent
9608395923
commit
34599c4f57
1 changed files with 20 additions and 0 deletions
|
@ -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 }
|
||||
|
||||
|
|
Loading…
Reference in a new issue