diff options
author | José Valim <jose.valim@gmail.com> | 2010-07-01 10:26:45 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-07-01 10:26:45 +0200 |
commit | e596a8e14cfb1f2ca19cd20ae7e40047d4819b3e (patch) | |
tree | e5b631cbca801afa53d8805ea2752b35d727df13 /activesupport/test | |
parent | f3fedd7f84c25d1d99a70af1e21e20abb48f100f (diff) | |
download | rails-e596a8e14cfb1f2ca19cd20ae7e40047d4819b3e.tar.gz rails-e596a8e14cfb1f2ca19cd20ae7e40047d4819b3e.tar.bz2 rails-e596a8e14cfb1f2ca19cd20ae7e40047d4819b3e.zip |
Add the possibility to have several behaviors in AS::Deprecation.
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/deprecation_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/activesupport/test/deprecation_test.rb b/activesupport/test/deprecation_test.rb index cf27357b32..44f1aebb37 100644 --- a/activesupport/test/deprecation_test.rb +++ b/activesupport/test/deprecation_test.rb @@ -80,6 +80,19 @@ class DeprecationTest < ActiveSupport::TestCase assert_deprecated(/foo=nil/) { @dtc.partially } end + def test_several_behaviors + @a, @b = nil, nil + + ActiveSupport::Deprecation.behavior = [ + Proc.new { |msg, callstack| @a = msg }, + Proc.new { |msg, callstack| @b = msg } + ] + + @dtc.partially + assert_match(/foo=nil/, @a) + assert_match(/foo=nil/, @b) + end + def test_deprecated_instance_variable_proxy assert_not_deprecated { @dtc.request.size } |