mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_tempfile.rb: use assert_file
* test/test_tempfile.rb: use assert_file for better failure messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9794af357e
commit
56ef54338b
1 changed files with 5 additions and 5 deletions
|
@ -76,7 +76,7 @@ class TestTempfile < Test::Unit::TestCase
|
|||
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::TestCase
|
|||
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::TestCase
|
|||
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::TestCase
|
|||
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
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue