summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-13 09:05:18 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-13 09:05:18 +0000
commit684aa1f98590ca97eab22ceecfea04c5cb5134bf (patch)
tree577ae9032218b919005d2e8dea4b14ad34039847 /test
parente7659bd2fd61b13800f2e5841659ab85a8aff525 (diff)
* eval.c (rb_mod_using): raise an ArgumentError if cyclic using is
detected. based on the patch by Charlie Somerville. [ruby-core:49092] Bug #7308 * test/ruby/test_refinement.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_refinement.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb
index e367532ec5..3ca00ed912 100644
--- a/test/ruby/test_refinement.rb
+++ b/test/ruby/test_refinement.rb
@@ -801,4 +801,25 @@ class TestRefinement < Test::Unit::TestCase
p c.foo
INPUT
end
+
+ def test_circular_using_is_not_allowed
+ a = Module.new
+ b = Module.new
+
+ assert_raise ArgumentError do
+ a.module_eval do
+ using a
+ end
+ end
+
+ b.module_eval do
+ using a
+ end
+
+ assert_raise ArgumentError do
+ a.module_eval do
+ using b
+ end
+ end
+ end
end