ruby-changes:8779
From: yugui <ko1@a...>
Date: Sat, 22 Nov 2008 21:34:51 +0900 (JST)
Subject: [ruby-changes:8779] Ruby:r20315 (ruby_1_9_1, trunk): * test/ruby/test_method.rb (test_default_accessiblity): test case for
yugui 2008-11-22 21:34:21 +0900 (Sat, 22 Nov 2008) New Revision: 20315 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20315 Log: * test/ruby/test_method.rb (test_default_accessiblity): test case for [ruby-dev:37124]. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/test/ruby/test_method.rb trunk/ChangeLog trunk/test/ruby/test_method.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 20314) +++ ChangeLog (revision 20315) @@ -1,3 +1,8 @@ +Sat Nov 22 21:29:54 2008 Yuki Sonoda (Yugui) <yugui@y...> + + * test/ruby/test_method.rb (test_default_accessiblity): test case for + [ruby-dev:37124]. + Sat Nov 22 18:24:24 2008 Yukihiro Matsumoto <matz@r...> * file.c (rb_file_world_writable_p): should return nil for non Index: test/ruby/test_method.rb =================================================================== --- test/ruby/test_method.rb (revision 20314) +++ test/ruby/test_method.rb (revision 20315) @@ -27,6 +27,15 @@ 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 @@ 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 Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 20314) +++ ruby_1_9_1/ChangeLog (revision 20315) @@ -1,3 +1,8 @@ +Sat Nov 22 21:29:54 2008 Yuki Sonoda (Yugui) <yugui@y...> + + * test/ruby/test_method.rb (test_default_accessiblity): test case for + [ruby-dev:37124]. + Wed Nov 19 14:14:38 2008 Yukihiro Matsumoto <matz@r...> * node.h (NOEX_MODFUNC): should be include NOEX_PRIVATE. Index: ruby_1_9_1/test/ruby/test_method.rb =================================================================== --- ruby_1_9_1/test/ruby/test_method.rb (revision 20314) +++ ruby_1_9_1/test/ruby/test_method.rb (revision 20315) @@ -28,6 +28,16 @@ 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 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/