summaryrefslogtreecommitdiff
path: root/test/test_tempfile.rb
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-04 15:26:11 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-04 15:26:11 +0000
commit2de0c729470d26cfcbf26f1076f3de4db525495e (patch)
treee2e5359e872ddff19a2b276b3112dc1e6a7d6f37 /test/test_tempfile.rb
parent85bcd2b35f7f5b5627c8a64381c1859037696ff9 (diff)
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
Diffstat (limited to 'test/test_tempfile.rb')
-rw-r--r--test/test_tempfile.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/test_tempfile.rb b/test/test_tempfile.rb
index ef035e358b..6a8933c392 100644
--- a/test/test_tempfile.rb
+++ b/test/test_tempfile.rb
@@ -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