1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #34702 from ysksn/test_deprecate_methods_without_alternate_method

Test ActiveSupport::Deprecation.deprecate_methods
This commit is contained in:
Yuji Yaginuma 2018-12-14 16:32:55 +09:00 committed by GitHub
commit 952cfbf149
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)