1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_method.rb (test_default_accessiblity): test case for

[ruby-dev:37124].



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yugui 2008-11-22 12:34:21 +00:00
parent c5ce3ea019
commit ab8114f481
2 changed files with 21 additions and 0 deletions

View file

@ -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].
Sat Nov 22 18:24:24 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* file.c (rb_file_world_writable_p): should return nil for non

View file

@ -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