[ruby/zlib] Fix the test broken in older versions

https://github.com/ruby/zlib/commit/fc89ff9ef0
This commit is contained in:
Nobuyoshi Nakada 2023-01-09 18:53:00 +09:00 committed by git
parent f6952a94eb
commit 9d078fe477

View File

@ -804,10 +804,16 @@ if defined? Zlib
io.rewind
gz0 = Zlib::GzipWriter.new(io)
assert_nil gz0.path
gz1 = Zlib::GzipReader.new(io)
assert_nil gz1.path
if IO.method_defined?(:path)
assert_nil gz0.path
assert_nil gz1.path
else
assert_raise(NoMethodError) { gz0.path }
assert_raise(NoMethodError) { gz1.path }
end
gz0.close
gz1.close
end