test/test_{tempfile,tmpdir}: get rid of leftover files
I ran out of inodes in $TMPDIR git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9366d7092f
commit
e22f3bf91f
@ -400,6 +400,9 @@ puts Tempfile.new('foo').path
|
|||||||
actual = Dir.glob(TRAVERSAL_PATH + '*').count
|
actual = Dir.glob(TRAVERSAL_PATH + '*').count
|
||||||
assert_equal expect, actual
|
assert_equal expect, actual
|
||||||
ensure
|
ensure
|
||||||
t&.close
|
if t
|
||||||
|
File.unlink(t.path)
|
||||||
|
t.close
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -64,15 +64,17 @@ class TestTmpdir < Test::Unit::TestCase
|
|||||||
|
|
||||||
def test_mktmpdir_traversal
|
def test_mktmpdir_traversal
|
||||||
expect = Dir.glob(TRAVERSAL_PATH + '*').count
|
expect = Dir.glob(TRAVERSAL_PATH + '*').count
|
||||||
Dir.mktmpdir(TRAVERSAL_PATH + 'foo')
|
Dir.mktmpdir(TRAVERSAL_PATH + 'foo') do
|
||||||
actual = Dir.glob(TRAVERSAL_PATH + '*').count
|
actual = Dir.glob(TRAVERSAL_PATH + '*').count
|
||||||
assert_equal expect, actual
|
assert_equal expect, actual
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_mktmpdir_traversal_array
|
def test_mktmpdir_traversal_array
|
||||||
expect = Dir.glob(TRAVERSAL_PATH + '*').count
|
expect = Dir.glob(TRAVERSAL_PATH + '*').count
|
||||||
Dir.mktmpdir([TRAVERSAL_PATH, 'foo'])
|
Dir.mktmpdir([TRAVERSAL_PATH, 'foo']) do
|
||||||
actual = Dir.glob(TRAVERSAL_PATH + '*').count
|
actual = Dir.glob(TRAVERSAL_PATH + '*').count
|
||||||
assert_equal expect, actual
|
assert_equal expect, actual
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user