diff options
author | Yuji Yaginuma <yuuji.yaginuma@gmail.com> | 2018-12-14 16:32:55 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-14 16:32:55 +0900 |
commit | 952cfbf14955c28d72b4e9694fe14d33dcd54ce5 (patch) | |
tree | 61a131a4d5a33384d615e8bea2b825fb8e8b2c60 /activesupport | |
parent | 08e7b369bfc26ed69e2dccfedbfac4a9af15154c (diff) | |
parent | ccbdbca36462c9b6dd44469158a968c3aa51fa97 (diff) | |
download | rails-952cfbf14955c28d72b4e9694fe14d33dcd54ce5.tar.gz rails-952cfbf14955c28d72b4e9694fe14d33dcd54ce5.tar.bz2 rails-952cfbf14955c28d72b4e9694fe14d33dcd54ce5.zip |
Merge pull request #34702 from ysksn/test_deprecate_methods_without_alternate_method
Test ActiveSupport::Deprecation.deprecate_methods
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/test/deprecation/method_wrappers_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/test/deprecation/method_wrappers_test.rb b/activesupport/test/deprecation/method_wrappers_test.rb index b04bce7a11..18729941bc 100644 --- a/activesupport/test/deprecation/method_wrappers_test.rb +++ b/activesupport/test/deprecation/method_wrappers_test.rb @@ -21,6 +21,13 @@ class MethodWrappersTest < ActiveSupport::TestCase end end + def test_deprecate_methods_without_alternate_method + warning = /old_method is deprecated and will be removed from Rails \d.\d./ + ActiveSupport::Deprecation.deprecate_methods(@klass, :old_method) + + assert_deprecated(warning) { assert_equal "abc", @klass.new.old_method } + end + def test_deprecate_methods_warning_default warning = /old_method is deprecated and will be removed from Rails \d.\d \(use new_method instead\)/ ActiveSupport::Deprecation.deprecate_methods(@klass, old_method: :new_method) |