diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-11-22 12:34:21 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-11-22 12:34:21 +0000 |
commit | 53b8b32da4a1e5947e349ece84080d2282ddc00c (patch) | |
tree | 265758d0bc2ef1a19d1ec3a447b8f729fdd44a6e /test | |
parent | 6d5f8858c1e6b2f804081bc092bedf79646fd301 (diff) | |
download | ruby-53b8b32da4a1e5947e349ece84080d2282ddc00c.tar.gz ruby-53b8b32da4a1e5947e349ece84080d2282ddc00c.tar.xz ruby-53b8b32da4a1e5947e349ece84080d2282ddc00c.zip |
* test/ruby/test_method.rb (test_default_accessiblity): test case for
[ruby-dev:37124].
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_method.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index d978050dc..088f34669 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -27,6 +27,15 @@ class TestMethod < Test::Unit::TestCase class Derived < Base def foo() :derived end end + class T + def initialize; end + def normal_method; end + end + module M + def func; end + module_function :func + def meth; end + end def test_arity assert_equal(0, method(:m0).arity) @@ -221,4 +230,11 @@ class TestMethod < Test::Unit::TestCase assert_raise(ArgumentError) { o.method(:foo=).call(1, 2, 3) } assert_raise(ArgumentError) { o.method(:foo).call(1) } end + + def test_default_accessibility + assert T.public_instance_methods.include?(:normal_method) + assert !T.public_instance_methods.include?(:initialize) + assert M.public_instance_methods.include?(:func) + assert !M.public_instance_methods.include?(:meth) + end end |