summaryrefslogtreecommitdiff
path: root/test/ruby/test_module.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-02 14:23:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-02 14:23:56 +0000
commita58c224dcff50eec3149df0f91b8a0f2e8099db6 (patch)
tree298c5c58a37d3eaa82cd1a77458721b4b6b93e52 /test/ruby/test_module.rb
parent908e70185162e31fc716a8ff7895f221f70ff97c (diff)
object.c: skip prepending modules
* object.c (rb_obj_is_kind_of): skip prepending modules. [ruby-core:54742] [Bug #8357] * object.c (rb_class_inherited_p): ditto. [ruby-core:54736] [Bug #8357] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_module.rb')
-rw-r--r--test/ruby/test_module.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index 0bb27be968..f27c11072a 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -1408,6 +1408,13 @@ class TestModule < Test::Unit::TestCase
c = labeled_class("c") {prepend b}
assert_operator(c, :<, b, bug6654)
assert_operator(c, :<, a, bug6654)
+ bug8357 = '[ruby-core:54736] [Bug #8357]'
+ b = labeled_module("b") {prepend a}
+ c = labeled_class("c") {include b}
+ assert_operator(c, :<, b, bug8357)
+ assert_operator(c, :<, a, bug8357)
+ bug8357 = '[ruby-core:54742] [Bug #8357]'
+ assert_kind_of(b, c.new, bug8357)
end
def test_prepend_instance_methods
@@ -1487,14 +1494,14 @@ class TestModule < Test::Unit::TestCase
def labeled_module(name, &block)
Module.new do
- singleton_class.class_eval {define_method(:to_s) {name}}
+ singleton_class.class_eval {define_method(:to_s) {name}; alias inspect to_s}
class_eval(&block) if block
end
end
def labeled_class(name, superclass = Object, &block)
Class.new(superclass) do
- singleton_class.class_eval {define_method(:to_s) {name}}
+ singleton_class.class_eval {define_method(:to_s) {name}; alias inspect to_s}
class_eval(&block) if block
end
end