diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-03 16:32:52 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-03 16:32:52 +0000 |
commit | 9bef3f051990afb7a437ddc120bbeaaabcc573e2 (patch) | |
tree | 4c893d53d3a8392d56cb04424e1d7b5e33be3d03 /test | |
parent | 2d3d84155d6c114a0f76888a8e2779e887722788 (diff) | |
download | ruby-9bef3f051990afb7a437ddc120bbeaaabcc573e2.tar.gz |
* insns.def (invokesuper): reverted r36612 so that super in an
aliased method will not call the same method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_super.rb | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb index d007f9c714..b2bde539ea 100644 --- a/test/ruby/test_super.rb +++ b/test/ruby/test_super.rb @@ -210,6 +210,42 @@ class TestSuper < Test::Unit::TestCase # [Bug #3351] def test_double_include - assert_equal([:Base, :Override, :Override], DoubleInclude::B.new.foo) + assert_equal([:Base, :Override], DoubleInclude::B.new.foo) + # should be changed as follows? + # assert_equal([:Base, :Override, :Override], DoubleInclude::B.new.foo) + end + + module DoubleInclude2 + class Base + def foo + [:Base] + end + end + + module Override + def foo + super << :Override + end + end + + class A < Base + def foo + super << :A + end + end + + class B < A + def foo + super << :B + end + end + + B.send(:include, Override) + A.send(:include, Override) + end + + def test_double_include + assert_equal([:Base, :Override, :A, :Override, :B], + DoubleInclude2::B.new.foo) end end |