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

ruby-changes:38614

From: nobu <ko1@a...>
Date: Sun, 31 May 2015 13:45:30 +0900 (JST)
Subject: [ruby-changes:38614] nobu:r50695 (trunk): test_tempfile.rb: use assert_predicate

nobu	2015-05-31 13:45:10 +0900 (Sun, 31 May 2015)

  New Revision: 50695

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

  Log:
    test_tempfile.rb: use assert_predicate
    
    * test/test_tempfile.rb: use assert_predicate and
      assert_not_predicate for better failure messages.

  Modified files:
    trunk/test/test_tempfile.rb
Index: test/test_tempfile.rb
===================================================================
--- test/test_tempfile.rb	(revision 50694)
+++ test/test_tempfile.rb	(revision 50695)
@@ -112,16 +112,16 @@ class TestTempfile < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/test_tempfile.rb#L112
 
   def test_close_and_close_p
     t = tempfile("foo")
-    assert !t.closed?
+    assert_not_predicate(t, :closed?)
     t.close
-    assert t.closed?
+    assert_predicate(t, :closed?)
   end
 
   def test_close_with_unlink_now_true_works
     t = tempfile("foo")
     path = t.path
     t.close(true)
-    assert t.closed?
+    assert_predicate(t, :closed?)
     assert_nil t.path
     assert_file.not_exist?(path)
   end
@@ -143,7 +143,7 @@ class TestTempfile < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/test_tempfile.rb#L143
     t = tempfile("foo")
     path = t.path
     t.close!
-    assert t.closed?
+    assert_predicate(t, :closed?)
     assert_nil t.path
     assert_file.not_exist?(path)
   end

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

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