summaryrefslogtreecommitdiff
path: root/test/ruby/test_module.rb
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-02 17:24:30 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-02 17:24:30 +0000
commite8237c5b3268cda18a4e90c9578760d1fa866a8a (patch)
tree20592e41411485401ebdd81a317d47c71f3831ce /test/ruby/test_module.rb
parent362f70c3cfb861c543ebb99f4ee816ad02dd3785 (diff)
merge revision(s) 39236: [Backport #7841]
* class.c (include_modules_at): detect cyclic prepend with original method table. [ruby-core:52205] [Bug #7841] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@39566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_module.rb')
-rw-r--r--test/ruby/test_module.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index 6fbf3af2e3..6b9ac4416b 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -1465,6 +1465,16 @@ class TestModule < Test::Unit::TestCase
assert_equal([:m1], Class.new(Class.new{def m2;end}){ prepend Module.new; def m1; end }.instance_methods(false), bug6660)
end
+ def test_cyclic_prepend
+ bug7841 = '[ruby-core:52205] [Bug #7841]'
+ m1 = Module.new
+ m2 = Module.new
+ m1.instance_eval { prepend(m2) }
+ assert_raise(ArgumentError, bug7841) do
+ m2.instance_eval { prepend(m1) }
+ end
+ end
+
def test_class_variables
m = Module.new
m.class_variable_set(:@@foo, 1)