From f824c6f15f3bfb0b2d7188fc2b8496ee8d69285f Mon Sep 17 00:00:00 2001 From: nagachika Date: Sat, 4 May 2013 14:48:20 +0000 Subject: merge revision(s) 40561: [Backport #8357] * 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/branches/ruby_2_0_0@40575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_module.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 1dd27561b0..e7523f6a1e 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -1368,6 +1368,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 @@ -1447,14 +1454,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 -- cgit v1.2.3