summaryrefslogtreecommitdiff
path: root/test/ruby/test_module.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2021-09-24 01:30:00 +0900
committerNobuyoshi Nakada <[email protected]>2021-09-24 08:29:00 +0900
commitb929af430c39df6597d2f3f53b82c38b1d76217b (patch)
tree7e76a81c8617d265e6cee0d42760fd735c51d9e4 /test/ruby/test_module.rb
parent65285bf673914424e960671d1d35e357c455985e (diff)
Use the flag for uninitialized module [Bug #18185]
Make `Module#ancestors` not to include `BasicObject`.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4883
Diffstat (limited to 'test/ruby/test_module.rb')
-rw-r--r--test/ruby/test_module.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index 429fab897e..be23b84c46 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -449,7 +449,9 @@ class TestModule < Test::Unit::TestCase
class Bug18185 < Module
module InstanceMethods
end
+ attr_reader :ancestor_list
def initialize
+ @ancestor_list = ancestors
include InstanceMethods
end
class Foo
@@ -470,6 +472,7 @@ class TestModule < Test::Unit::TestCase
assert_equal(1, anc.count(BasicObject), ->{anc.inspect})
b = c.new(key: 1)
assert_equal(1, b.key)
+ assert_not_include(mod.ancestor_list, BasicObject)
end
def test_dup