From 86d4e189580e84c4b7effc0c3ebd25b4e8dc4fee Mon Sep 17 00:00:00 2001 From: yui-knk Date: Sun, 28 Feb 2016 11:00:14 +0900 Subject: Deprecate `Module.local_constants` After Ruby 1.9, we can easily get the constants that have been defined locally by `Module.constants(false)`. --- activesupport/test/core_ext/module_test.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'activesupport/test/core_ext/module_test.rb') diff --git a/activesupport/test/core_ext/module_test.rb b/activesupport/test/core_ext/module_test.rb index 0ed66f8c37..cbe025624c 100644 --- a/activesupport/test/core_ext/module_test.rb +++ b/activesupport/test/core_ext/module_test.rb @@ -328,7 +328,13 @@ class ModuleTest < ActiveSupport::TestCase end def test_local_constants - assert_equal %w(Constant1 Constant3), Ab.local_constants.sort.map(&:to_s) + ActiveSupport::Deprecation.silence do + assert_equal %w(Constant1 Constant3), Ab.local_constants.sort.map(&:to_s) + end + end + + def test_test_local_constants_is_deprecated + assert_deprecated { Ab.local_constants.sort.map(&:to_s) } end end -- cgit v1.2.3