diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2019-01-15 17:21:19 -0500 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2019-01-17 16:08:34 -0500 |
commit | 6eb1d56a333fd2015610d31793ed6281acd66551 (patch) | |
tree | e0be225b000d0446cd9385343ef0ff4bd8718559 /activesupport/test/core_ext | |
parent | 0ce67d3cd6d1b7b9576b07fecae3dd5b422a5689 (diff) | |
download | rails-6eb1d56a333fd2015610d31793ed6281acd66551.tar.gz rails-6eb1d56a333fd2015610d31793ed6281acd66551.tar.bz2 rails-6eb1d56a333fd2015610d31793ed6281acd66551.zip |
Remove deprecated `Module#reachable?` method
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/module/reachable_test.rb | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/activesupport/test/core_ext/module/reachable_test.rb b/activesupport/test/core_ext/module/reachable_test.rb deleted file mode 100644 index f356d46957..0000000000 --- a/activesupport/test/core_ext/module/reachable_test.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -require "abstract_unit" -require "active_support/core_ext/module/reachable" - -class AnonymousTest < ActiveSupport::TestCase - test "an anonymous class or module is not reachable" do - assert_deprecated do - assert_not_predicate Module.new, :reachable? - assert_not_predicate Class.new, :reachable? - end - end - - test "ordinary named classes or modules are reachable" do - assert_deprecated do - assert_predicate Kernel, :reachable? - assert_predicate Object, :reachable? - end - end - - test "a named class or module whose constant has gone is not reachable" do - c = eval "class C; end; C" - m = eval "module M; end; M" - - self.class.send(:remove_const, :C) - self.class.send(:remove_const, :M) - - assert_deprecated do - assert_not_predicate c, :reachable? - assert_not_predicate m, :reachable? - end - end - - test "a named class or module whose constants store different objects are not reachable" do - c = eval "class C; end; C" - m = eval "module M; end; M" - - self.class.send(:remove_const, :C) - self.class.send(:remove_const, :M) - - eval "class C; end" - eval "module M; end" - - assert_deprecated do - assert_predicate C, :reachable? - assert_predicate M, :reachable? - assert_not_predicate c, :reachable? - assert_not_predicate m, :reachable? - end - end -end |