aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_method.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-13 09:18:05 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-13 09:18:05 +0000
commit3ac0ec4ecdea849143ed64e8935e6675b341e44b (patch)
treefe18c8213610bfdbca51b687133caf5ab297b882 /test/ruby/test_method.rb
parent287d2adab0ce45018ada9941ce4eaf67ba6a4d3a (diff)
downloadruby-3ac0ec4ecdea849143ed64e8935e6675b341e44b.tar.gz
test/ruby: better assertions
* test/ruby: use better assertions instead of mere assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_method.rb')
-rw-r--r--test/ruby/test_method.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb
index 18c25f14d1..273f3f83d1 100644
--- a/test/ruby/test_method.rb
+++ b/test/ruby/test_method.rb
@@ -391,14 +391,16 @@ class TestMethod < Test::Unit::TestCase
end
def test_default_accessibility
- assert T.public_instance_methods.include?(:normal_method), 'normal methods are public by default'
- assert !T.public_instance_methods.include?(:initialize), '#initialize is private'
- assert !T.public_instance_methods.include?(:initialize_copy), '#initialize_copy is private'
- assert !T.public_instance_methods.include?(:initialize_clone), '#initialize_clone is private'
- assert !T.public_instance_methods.include?(:initialize_dup), '#initialize_dup is private'
- assert !T.public_instance_methods.include?(:respond_to_missing?), '#respond_to_missing? is private'
- assert !M.public_instance_methods.include?(:func), 'module methods are private by default'
- assert M.public_instance_methods.include?(:meth), 'normal methods are public by default'
+ tmethods = T.public_instance_methods
+ assert_include tmethods, :normal_method, 'normal methods are public by default'
+ assert_not_include tmethods, :initialize, '#initialize is private'
+ assert_not_include tmethods, :initialize_copy, '#initialize_copy is private'
+ assert_not_include tmethods, :initialize_clone, '#initialize_clone is private'
+ assert_not_include tmethods, :initialize_dup, '#initialize_dup is private'
+ assert_not_include tmethods, :respond_to_missing?, '#respond_to_missing? is private'
+ mmethods = M.public_instance_methods
+ assert_not_include mmethods, :func, 'module methods are private by default'
+ assert_include mmethods, :meth, 'normal methods are public by default'
end
define_method(:pm0) {||}
@@ -579,7 +581,7 @@ class TestMethod < Test::Unit::TestCase
end
assert_equal(c, x.method(:foo).owner)
assert_equal(x.singleton_class, x.method(:bar).owner)
- assert(x.method(:foo) != x.method(:bar), bug7613)
+ assert_not_equal(x.method(:foo), x.method(:bar), bug7613)
end
def test_included