1f79b23
From 26e5ba521208706ae68f19062d4ad24ad257aa47 Mon Sep 17 00:00:00 2001
1f79b23
From: Jun Aruga <jaruga@redhat.com>
1f79b23
Date: Mon, 15 Apr 2024 15:46:30 +0200
1f79b23
Subject: [PATCH] Make a test depending on the rubyzip gem optional.
1f79b23
1f79b23
Because I still want to pass the nokogiri's unit tests in a downstream nokogiri
1f79b23
package on a Linux distro such as CentOS 10 Stream and RHEL 10, where we don't
1f79b23
want to manage the rubyzip gem[1].
1f79b23
1f79b23
[1] https://rubygems.org/gems/rubyzip
1f79b23
---
1f79b23
 test/xml/test_document_encoding.rb | 6 +++++-
1f79b23
 1 file changed, 5 insertions(+), 1 deletion(-)
1f79b23
1f79b23
diff --git a/test/xml/test_document_encoding.rb b/test/xml/test_document_encoding.rb
1f79b23
index cd8b1b4da2..c0cb93b283 100644
1f79b23
--- a/test/xml/test_document_encoding.rb
1f79b23
+++ b/test/xml/test_document_encoding.rb
1f79b23
@@ -91,7 +91,11 @@ class TestDocumentEncoding < Nokogiri::TestCase
1f79b23
         describe "pseudo-IO" do
1f79b23
           it "serializes correctly with Zip::OutputStream objects" do
1f79b23
             # https://github.com/sparklemotion/nokogiri/issues/2773
1f79b23
-            require "zip"
1f79b23
+            begin
1f79b23
+              require "zip"
1f79b23
+            rescue LoadError
1f79b23
+              skip("rubyzip is not installed")
1f79b23
+            end
1f79b23
 
1f79b23
             xml = <<~XML
1f79b23