diff options
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | test/ruby/test_method.rb | 17 |
2 files changed, 22 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Sat Nov 22 21:29:54 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp> + + * test/ruby/test_method.rb (test_default_accessiblity): test case for + [ruby-dev:37124]. + Wed Nov 19 14:14:38 2008 Yukihiro Matsumoto <matz@ruby-lang.org> * node.h (NOEX_MODFUNC): should be include NOEX_PRIVATE. 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 |
