From 0e743c8a6d34bd4416fd986c9777b22744ad2283 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 13 May 2021 23:07:27 -0400 Subject: [PATCH] test: update behavior of namespaces in HTML libxml 2.9.12 fixes the parser to ignore namespaces in HTML docs, likely in upstream commit 21ca882. --- test/xml/test_node.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/xml/test_node.rb b/test/xml/test_node.rb index 54cc9eccd..11a8b993a 100644 --- a/test/xml/test_node.rb +++ b/test/xml/test_node.rb @@ -1047,13 +1047,15 @@ def test_namespace_without_an_href_on_html_node node = html.at("div").children.first assert_not_nil(node) - if Nokogiri.uses_libxml? + if Nokogiri.uses_libxml?(">= 2.9.12") + assert_empty(node.namespaces.keys) + assert_equal("

foo

", node.to_html) + elsif Nokogiri.uses_libxml? assert_equal(1, node.namespaces.keys.size) assert(node.namespaces.has_key?('xmlns:o')) assert_nil(node.namespaces['xmlns:o']) assert_equal("

foo

", node.to_html) - else - # Xerces does something completely different + else # jruby assert_empty(node.namespaces.keys) assert_equal("foo", node.to_html) end