aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuji Yaginuma <yuuji.yaginuma@gmail.com>2018-12-14 16:32:55 +0900
committerGitHub <noreply@github.com>2018-12-14 16:32:55 +0900
commit952cfbf14955c28d72b4e9694fe14d33dcd54ce5 (patch)
tree61a131a4d5a33384d615e8bea2b825fb8e8b2c60
parent08e7b369bfc26ed69e2dccfedbfac4a9af15154c (diff)
parentccbdbca36462c9b6dd44469158a968c3aa51fa97 (diff)
downloadrails-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
-rw-r--r--activesupport/test/deprecation/method_wrappers_test.rb7
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)