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

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
This commit is contained in:
nobu 2013-12-13 09:18:05 +00:00
parent 287d2adab0
commit 3ac0ec4ecd
45 changed files with 532 additions and 510 deletions

View file

@ -39,13 +39,13 @@ End
h = {}
ObjectSpace.count_objects(h)
assert_kind_of(Hash, h)
assert(h.keys.all? {|x| x.is_a?(Symbol) || x.is_a?(Integer) })
assert(h.values.all? {|x| x.is_a?(Integer) })
assert_empty(h.keys.delete_if {|x| x.is_a?(Symbol) || x.is_a?(Integer) })
assert_empty(h.values.delete_if {|x| x.is_a?(Integer) })
h = ObjectSpace.count_objects
assert_kind_of(Hash, h)
assert(h.keys.all? {|x| x.is_a?(Symbol) || x.is_a?(Integer) })
assert(h.values.all? {|x| x.is_a?(Integer) })
assert_empty(h.keys.delete_if {|x| x.is_a?(Symbol) || x.is_a?(Integer) })
assert_empty(h.values.delete_if {|x| x.is_a?(Integer) })
assert_raise(TypeError) { ObjectSpace.count_objects(1) }