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 | 76af40289573bcc7dcc930b1af7a5b1e33dacd63 (patch) | |
| tree | 0d526b7f329b0fc5f039d5f140f74c10aade0716 /test | |
| parent | 190b532ad82750f1e1136a8817501083f86a0ea6 (diff) | |
| download | ruby-76af40289573bcc7dcc930b1af7a5b1e33dacd63.tar.gz ruby-76af40289573bcc7dcc930b1af7a5b1e33dacd63.tar.xz ruby-76af40289573bcc7dcc930b1af7a5b1e33dacd63.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/branches/ruby_1_9_1@20315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
| -rw-r--r-- | test/ruby/test_method.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb index d978050dc..cbf1e1e92 100644 --- a/test/ruby/test_method.rb +++ b/test/ruby/test_method.rb @@ -28,6 +28,16 @@ class TestMethod < Test::Unit::TestCase 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) assert_equal(1, method(:m1).arity) @@ -221,4 +231,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 |
