aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYosuke Kabuto <bluewhale1982@gmail.com>2018-12-14 11:49:54 +0900
committerYosuke Kabuto <bluewhale1982@gmail.com>2018-12-14 11:49:54 +0900
commitccbdbca36462c9b6dd44469158a968c3aa51fa97 (patch)
tree122d700160004e6b329cbd13177d71734c33d503
parentf907b418aecfb6dab4e30149b88a8593ddd321b9 (diff)
downloadrails-ccbdbca36462c9b6dd44469158a968c3aa51fa97.tar.gz
rails-ccbdbca36462c9b6dd44469158a968c3aa51fa97.tar.bz2
rails-ccbdbca36462c9b6dd44469158a968c3aa51fa97.zip
Test ActiveSupport::Deprecation.deprecate_methods
There was no test without an alternate method name is given.
-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)