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

ruby-changes:38613

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

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

  New Revision: 50694

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

  Log:
    test_tempfile.rb: use assert_file
    
    * test/test_tempfile.rb: use assert_file for better failure
      messages.

  Modified files:
    trunk/test/test_tempfile.rb
Index: test/test_tempfile.rb
===================================================================
--- test/test_tempfile.rb	(revision 50693)
+++ test/test_tempfile.rb	(revision 50694)
@@ -76,7 +76,7 @@ class TestTempfile < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/test_tempfile.rb#L76
     assert_file.exist?(path)
 
     t.unlink
-    assert !File.exist?(path)
+    assert_file.not_exist?(path)
 
     assert_nil t.path
   end
@@ -99,7 +99,7 @@ class TestTempfile < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/test_tempfile.rb#L99
     begin
       path = tempfile.path
       tempfile.unlink
-      assert !File.exist?(path)
+      assert_file.not_exist?(path)
       tempfile.write("hello ")
       tempfile.write("world\n")
       tempfile.rewind
@@ -123,7 +123,7 @@ class TestTempfile < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/test_tempfile.rb#L123
     t.close(true)
     assert t.closed?
     assert_nil t.path
-    assert !File.exist?(path)
+    assert_file.not_exist?(path)
   end
 
   def test_close_with_unlink_now_true_does_not_unlink_if_already_unlinked
@@ -145,7 +145,7 @@ class TestTempfile < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/test_tempfile.rb#L145
     t.close!
     assert t.closed?
     assert_nil t.path
-    assert !File.exist?(path)
+    assert_file.not_exist?(path)
   end
 
   def test_close_bang_does_not_unlink_if_already_unlinked
@@ -207,7 +207,7 @@ File.open(path, "w").close https://github.com/ruby/ruby/blob/trunk/test/test_tempfile.rb#L207
     assert_in_out_err('-rtempfile', <<-'EOS') do |(filename), (error)|
 puts Tempfile.new('foo').path
     EOS
-      assert !File.exist?(filename), "tempfile must not be exist after GC."
+      assert_file.for("tempfile must not be exist after GC.").not_exist?(filename)
       assert_nil(error)
     end
   end

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

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