diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2017-09-17 02:20:02 +0300 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2017-09-17 02:20:02 +0300 |
commit | 9e4827a8ae40de50503c530b8cfd0a0789e27956 (patch) | |
tree | fbbcdbf0df9ab00691c806a2da6857e933ef4e1f /activesupport/test/core_ext | |
parent | f8e4c837c765891311e1a6dac7e555526c9c283e (diff) | |
download | rails-9e4827a8ae40de50503c530b8cfd0a0789e27956.tar.gz rails-9e4827a8ae40de50503c530b8cfd0a0789e27956.tar.bz2 rails-9e4827a8ae40de50503c530b8cfd0a0789e27956.zip |
Deprecate `Module#reachable?` method
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/module/reachable_test.rb | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/activesupport/test/core_ext/module/reachable_test.rb b/activesupport/test/core_ext/module/reachable_test.rb index a69fc6839e..097a72fa5b 100644 --- a/activesupport/test/core_ext/module/reachable_test.rb +++ b/activesupport/test/core_ext/module/reachable_test.rb @@ -5,13 +5,17 @@ require "active_support/core_ext/module/reachable" class AnonymousTest < ActiveSupport::TestCase test "an anonymous class or module is not reachable" do - assert !Module.new.reachable? - assert !Class.new.reachable? + assert_deprecated do + assert !Module.new.reachable? + assert !Class.new.reachable? + end end test "ordinary named classes or modules are reachable" do - assert Kernel.reachable? - assert Object.reachable? + assert_deprecated do + assert Kernel.reachable? + assert Object.reachable? + end end test "a named class or module whose constant has gone is not reachable" do @@ -21,8 +25,10 @@ class AnonymousTest < ActiveSupport::TestCase self.class.send(:remove_const, :C) self.class.send(:remove_const, :M) - assert !c.reachable? - assert !m.reachable? + assert_deprecated do + assert !c.reachable? + assert !m.reachable? + end end test "a named class or module whose constants store different objects are not reachable" do @@ -35,9 +41,11 @@ class AnonymousTest < ActiveSupport::TestCase eval "class C; end" eval "module M; end" - assert C.reachable? - assert M.reachable? - assert !c.reachable? - assert !m.reachable? + assert_deprecated do + assert C.reachable? + assert M.reachable? + assert !c.reachable? + assert !m.reachable? + end end end |