diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-08 14:40:38 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-08 14:40:38 +0000 |
commit | 8e8bb6c17390e949d4a51c96aa901651a679458d (patch) | |
tree | 248ba1e348257628bb63222eac2c75fc87b8edf6 /test/ruby/test_method.rb | |
parent | 479a3c4c8b4d6c612a50a6cabab04921378a6f4b (diff) | |
download | ruby-8e8bb6c17390e949d4a51c96aa901651a679458d.tar.gz |
* proc.c (mnew): don't check visibility of method body if public
ZSUPER method is found. [ruby-dev:39767]
* test/ruby/test_method.rb: add a test for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_method.rb')
-rw-r--r-- | test/ruby/test_method.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index d5d6a0e68d..08603c9981 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -312,4 +312,19 @@ class TestMethod < Test::Unit::TestCase assert_equal([[:req, :a], [:opt, :b], [:rest, :c], [:req, :d], [:block, :e]], self.class.instance_method(:pmo7).parameters) assert_equal([[:req], [:block, :b]], self.class.instance_method(:pma1).parameters) end + + def test_public_method_with_zsuper_method + c = Class.new + c.class_eval do + def foo + :ok + end + private :foo + end + d = Class.new(c) + d.class_eval do + public :foo + end + assert_equal(:ok, d.new.public_method(:foo).call) + end end |