ruby-changes:37878
From: nobu <ko1@a...>
Date: Fri, 13 Mar 2015 14:13:04 +0900 (JST)
Subject: [ruby-changes:37878] nobu:r49959 (trunk): test_objspace.rb: better assertions
nobu 2015-03-13 14:12:43 +0900 (Fri, 13 Mar 2015) New Revision: 49959 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49959 Log: test_objspace.rb: better assertions * test/objspace/test_objspace.rb: use assertions for better failure messages. Modified files: trunk/test/objspace/test_objspace.rb Index: test/objspace/test_objspace.rb =================================================================== --- test/objspace/test_objspace.rb (revision 49958) +++ test/objspace/test_objspace.rb (revision 49959) @@ -54,16 +54,16 @@ class TestObjSpace < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/objspace/test_objspace.rb#L54 def test_count_objects_size res = ObjectSpace.count_objects_size - assert_equal(false, res.empty?) - assert_equal(true, res[:TOTAL] > 0) + assert_not_empty(res) + assert_operator(res[:TOTAL], :>, 0) arg = {} ObjectSpace.count_objects_size(arg) - assert_equal(false, arg.empty?) + assert_not_empty(arg) end def test_count_nodes res = ObjectSpace.count_nodes - assert_equal(false, res.empty?) + assert_not_empty(res) arg = {} ObjectSpace.count_nodes(arg) assert_not_empty(arg) @@ -73,10 +73,10 @@ class TestObjSpace < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/objspace/test_objspace.rb#L73 def test_count_tdata_objects res = ObjectSpace.count_tdata_objects - assert_equal(false, res.empty?) + assert_not_empty(res) arg = {} ObjectSpace.count_tdata_objects(arg) - assert_equal(false, arg.empty?) + assert_not_empty(arg) end def test_reachable_objects_from -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/