summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-03 10:27:21 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-03 10:27:21 +0000
commit2d3d84155d6c114a0f76888a8e2779e887722788 (patch)
treeeaaded667ea40494ac6c5c1840931f457eb04a7a /test/ruby
parentbea3f0df108ad4a983843eae83231cca2843b30d (diff)
* insns.def (invokesuper): don't skip the same class. instead, use
rb_method_entry_get_with_omod() to avoid infinite loop when super is used with refinements. [ruby-core:30450] [Bug #3351] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_super.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb
index 743b71d73f..d007f9c714 100644
--- a/test/ruby/test_super.rb
+++ b/test/ruby/test_super.rb
@@ -184,4 +184,32 @@ class TestSuper < Test::Unit::TestCase
mid.subseq
end
end
+
+ module DoubleInclude
+ class Base
+ def foo
+ [:Base]
+ end
+ end
+
+ module Override
+ def foo
+ super << :Override
+ end
+ end
+
+ class A < Base
+ end
+
+ class B < A
+ end
+
+ B.send(:include, Override)
+ A.send(:include, Override)
+ end
+
+ # [Bug #3351]
+ def test_double_include
+ assert_equal([:Base, :Override, :Override], DoubleInclude::B.new.foo)
+ end
end