[前][次][番号順一覧][スレッド一覧]

ruby-changes:25050

From: nobu <ko1@a...>
Date: Sat, 6 Oct 2012 09:48:42 +0900 (JST)
Subject: [ruby-changes:25050] nobu:r37102 (trunk): test_objspace.rb: refine

nobu	2012-10-06 09:48:28 +0900 (Sat, 06 Oct 2012)

  New Revision: 37102

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37102

  Log:
    test_objspace.rb: refine
    
    * test/objspace/test_objspace.rb (test_reachable_objects_from): use
      proper assertions, and show messages than comments.

  Modified files:
    trunk/test/objspace/test_objspace.rb

Index: test/objspace/test_objspace.rb
===================================================================
--- test/objspace/test_objspace.rb	(revision 37101)
+++ test/objspace/test_objspace.rb	(revision 37102)
@@ -85,13 +85,11 @@
       max = [refs.size, max].max
 
       unless refs.nil?
-        refs.each{|ro|
-          # check this referenced object is not internal object
-          assert_equal(false, ro.nil?)
+        refs.each_with_index {|ro, i|
+          assert_not_nil(ro, "#{i}: this referenced object is internal object")
         }
       end
     }
-    STDERR.puts max
-    assert_equal(true, max >= 1_001) # 1000 elems + Array class
+    assert_operator(max, :>=, 1_001, "1000 elems + Array class")
   end
 end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]