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:
commit
952cfbf149
1 changed files with 7 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue