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 (test_create_with{,out}_block): use assert_file for descriptive failure messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
98311146cc
commit
4ebaed6bee
1 changed files with 4 additions and 4 deletions
|
@ -329,18 +329,18 @@ puts Tempfile.new('foo').path
|
|||
path = nil
|
||||
Tempfile.create("tempfile-create") {|f|
|
||||
path = f.path
|
||||
assert(File.exist?(path))
|
||||
assert_file.exist?(path)
|
||||
}
|
||||
assert(!File.exist?(path))
|
||||
assert_file.not_exist?(path)
|
||||
end
|
||||
|
||||
def test_create_without_block
|
||||
path = nil
|
||||
f = Tempfile.create("tempfile-create")
|
||||
path = f.path
|
||||
assert(File.exist?(path))
|
||||
assert_file.exist?(path)
|
||||
f.close
|
||||
assert(File.exist?(path))
|
||||
assert_file.exist?(path)
|
||||
ensure
|
||||
f.close if f && !f.closed?
|
||||
File.unlink path if path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue