Skip to content

Commit fc89ff9

Browse files
committed
Fix the test broken in older versions
1 parent 9b6d20f commit fc89ff9

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/zlib/test_zlib.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,10 +804,16 @@ def test_path_tmpfile
804804
io.rewind
805805

806806
gz0 = Zlib::GzipWriter.new(io)
807-
assert_nil gz0.path
808-
809807
gz1 = Zlib::GzipReader.new(io)
810-
assert_nil gz1.path
808+
809+
if IO.method_defined?(:path)
810+
assert_nil gz0.path
811+
assert_nil gz1.path
812+
else
813+
assert_raise(NoMethodError) { gz0.path }
814+
assert_raise(NoMethodError) { gz1.path }
815+
end
816+
811817
gz0.close
812818
gz1.close
813819
end

0 commit comments

Comments
 (0)