diff --git a/test/xml/test_node.rb b/test/xml/test_node.rb
index 80fb66d37b..137c46d61b 100644
--- a/test/xml/test_node.rb
+++ b/test/xml/test_node.rb
@@ -1141,7 +1141,10 @@ def test_namespace_without_an_href_on_html_node
node = html.at("div").children.first
refute_nil(node)
- if Nokogiri.uses_libxml?(">= 2.9.12")
+ if Nokogiri.uses_libxml?(">= 2.11.0") || Nokogiri.jruby?
+ assert_empty(node.namespaces.keys)
+ assert_equal("
foo
", node.to_html) elsif Nokogiri.uses_libxml? @@ -1149,9 +1152,6 @@ def test_namespace_without_an_href_on_html_node assert(node.namespaces.key?("xmlns:o")) assert_nil(node.namespaces["xmlns:o"]) assert_equal("foo
", node.to_html) - else # jruby - assert_empty(node.namespaces.keys) - assert_equal("