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:
parent
f907b418ae
commit
ccbdbca364
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