Skip to content

Commit 1bed54d

Browse files
committed
Clear temporary directory
1 parent 78658aa commit 1bed54d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/zlib/test_zlib.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,8 @@ def test_path_tmpfile
801801
gz.write "hi"
802802
gz.close
803803

804-
File.open(Dir.mktmpdir, File::RDWR | File::TMPFILE) do |io|
804+
tmpdir = Dir.mktmpdir("zlib_file_tmpfile")
805+
File.open(tmpdir, File::RDWR | File::TMPFILE) do |io|
805806
io.write sio.string
806807
io.rewind
807808

@@ -825,6 +826,8 @@ def test_path_tmpfile
825826
omit 'O_TMPFILE not supported (EISDIR)'
826827
rescue Errno::EOPNOTSUPP
827828
omit 'O_TMPFILE not supported (EOPNOTSUPP)'
829+
ensure
830+
Dir.rmdir(tmpdir) if tmpdir
828831
end
829832
end
830833
end

0 commit comments

Comments
 (0)