Skip to content

Commit

Permalink
Clear temporary directory
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Apr 20, 2024
1 parent 78658aa commit 1bed54d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/zlib/test_zlib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,8 @@ def test_path_tmpfile
gz.write "hi"
gz.close

File.open(Dir.mktmpdir, File::RDWR | File::TMPFILE) do |io|
tmpdir = Dir.mktmpdir("zlib_file_tmpfile")
File.open(tmpdir, File::RDWR | File::TMPFILE) do |io|
io.write sio.string
io.rewind

Expand All @@ -825,6 +826,8 @@ def test_path_tmpfile
omit 'O_TMPFILE not supported (EISDIR)'
rescue Errno::EOPNOTSUPP
omit 'O_TMPFILE not supported (EOPNOTSUPP)'
ensure
Dir.rmdir(tmpdir) if tmpdir
end
end
end
Expand Down

0 comments on commit 1bed54d

Please sign in to comment.