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

Test ActiveSupport::Deprecation.deprecate_methods

There was no test without an alternate method name is given.
This commit is contained in:
Yosuke Kabuto 2018-12-14 11:49:54 +09:00
parent f907b418ae
commit ccbdbca364

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)