Skip to content

Commit

Permalink
[ruby/zlib] Fix the test broken in older versions
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu authored and matzbot committed Jan 9, 2023
1 parent f6952a9 commit 9d078fe
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/zlib/test_zlib.rb
Expand Up @@ -804,10 +804,16 @@ def test_path_tmpfile
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
Expand Down

0 comments on commit 9d078fe

Please sign in to comment.