From 889ee2a9cb1e190bfa664cbf3552585f4d0a09a7 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 54cc9eccd4..11a8b993a9 100644 --- a/test/xml/test_node.rb +++ b/test/xml/test_node.rb @@ -1055,13 +1055,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