Make the metaclass of Refinement explicitly
Otherwise, singleton methods of Module are not inherited unless Refinement.singleton_class is called.
This commit is contained in:
parent
8a49c7e481
commit
37395ffa05
2
class.c
2
class.c
@ -689,6 +689,8 @@ Init_class_hierarchy(void)
|
||||
RBASIC_SET_CLASS(rb_cObject, rb_cClass);
|
||||
RBASIC_SET_CLASS(rb_cRefinement, rb_cClass);
|
||||
RBASIC_SET_CLASS(rb_cBasicObject, rb_cClass);
|
||||
|
||||
ENSURE_EIGENCLASS(rb_cRefinement);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2668,6 +2668,10 @@ class TestRefinement < Test::Unit::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
def test_inherit_singleton_methods_of_module
|
||||
assert_equal([], Refinement.used_modules)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def eval_using(mod, s)
|
||||
|
Loading…
x
Reference in New Issue
Block a user