From 2b11bcb84ec0e9326ce03a2ec8f0ed2ee349d3c1 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 20 Apr 2024 19:45:01 +0900 Subject: [PATCH] [ruby/zlib] Clear temporary directory https://github.com/ruby/zlib/commit/1bed54dcf7 --- test/zlib/test_zlib.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/zlib/test_zlib.rb b/test/zlib/test_zlib.rb index 502ccceec5..ae4adc21fe 100644 --- a/test/zlib/test_zlib.rb +++ b/test/zlib/test_zlib.rb @@ -801,7 +801,8 @@ if defined? Zlib 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 @@ -825,6 +826,8 @@ if defined? Zlib omit 'O_TMPFILE not supported (EISDIR)' rescue Errno::EOPNOTSUPP omit 'O_TMPFILE not supported (EOPNOTSUPP)' + ensure + Dir.rmdir(tmpdir) if tmpdir end end end