mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test/test_tempfile.rb: close a file object created by Tempfile.create
To stop a "Leaked file descriptor" warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
85bcd2b35f
commit
2de0c72947
1 changed files with 3 additions and 1 deletions
|
@ -396,8 +396,10 @@ puts Tempfile.new('foo').path
|
|||
|
||||
def test_create_traversal_dir
|
||||
expect = Dir.glob(TRAVERSAL_PATH + '*').count
|
||||
Tempfile.create(TRAVERSAL_PATH + 'foo')
|
||||
t = Tempfile.create(TRAVERSAL_PATH + 'foo')
|
||||
actual = Dir.glob(TRAVERSAL_PATH + '*').count
|
||||
assert_equal expect, actual
|
||||
ensure
|
||||
t.close
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue