aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-04-16 16:43:08 +0900
committerRyuta Kamizono <kamipo@gmail.com>2019-04-19 22:00:09 +0900
commit8afdfdcfc92720162920aa6b59954ff4a1bfe831 (patch)
treefb67efaee73e2b4d27c4b1d49c93adba5bb8593c /activesupport/test
parent00310bf61aa0a3be1a4618e0dd3886dcfd05c799 (diff)
downloadrails-8afdfdcfc92720162920aa6b59954ff4a1bfe831.tar.gz
rails-8afdfdcfc92720162920aa6b59954ff4a1bfe831.tar.bz2
rails-8afdfdcfc92720162920aa6b59954ff4a1bfe831.zip
Refactor `ActiveSupport::Deprecation.deprecate_methods` not to expose internal methods
In #33325, `deprecate_methods` is replaced from `prepend` to completely emurated `alias_method_chain`, it exposed two internal methods `xxx_with_deprecation` and `xxx_without_deprecation`. After that, #34648 restored the `prepend` implementation, which doesn't expose any internal methods, so we no longer be able to ensure to always expose that internal methods. As I said at https://github.com/rails/rails/pull/33325#issuecomment-409016725, I think that internal methods exposed is not a specification but a limitation when using `alias_method_chain`, there is no longer a reason to follow that limitation.
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/deprecation/method_wrappers_test.rb8
1 files changed, 0 insertions, 8 deletions
diff --git a/activesupport/test/deprecation/method_wrappers_test.rb b/activesupport/test/deprecation/method_wrappers_test.rb
index 18729941bc..0aa3233aab 100644
--- a/activesupport/test/deprecation/method_wrappers_test.rb
+++ b/activesupport/test/deprecation/method_wrappers_test.rb
@@ -89,12 +89,4 @@ class MethodWrappersTest < ActiveSupport::TestCase
warning = /old_method is deprecated and will be removed from Rails \d.\d \(use new_method instead\)/
assert_deprecated(warning) { assert_equal "abc", @klass.old_method }
end
-
- def test_method_with_without_deprecation_is_exposed
- ActiveSupport::Deprecation.deprecate_methods(@klass, old_method: :new_method)
-
- warning = /old_method is deprecated and will be removed from Rails \d.\d \(use new_method instead\)/
- assert_deprecated(warning) { assert_equal "abc", @klass.new.old_method_with_deprecation }
- assert_equal "abc", @klass.new.old_method_without_deprecation
- end
end