Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Last active Aug 29, 2015
Embed
What would you like to do?
diff --git a/test/namespaces/test_namespaces_in_merged_doc.rb b/test/namespaces/test_namespaces_in_merged_doc.rb
index fb7355d..d9b739c 100644
--- a/test/namespaces/test_namespaces_in_merged_doc.rb
+++ b/test/namespaces/test_namespaces_in_merged_doc.rb
@@ -21,7 +21,10 @@ module Nokogiri
root = @doc1.at("defs")
toadd = @doc2.at("svg")
- root.add_child(toadd.children)
+ text_node = @doc2.at("text")
+ toadd.children.each do |child|
+ root.add_child child.clone
+ end
new_node = @doc1.at("text")
@@ -29,9 +32,9 @@ module Nokogiri
assert_equal "http://www.w3.org/2000/svg", toadd.namespace.href
assert_equal "http://www.w3.org/2000/svg", new_node.namespace.href
- assert_equal nil, root.namespace.prefix
- assert_equal nil, toadd.namespace.prefix
- assert_equal nil, new_node.namespace.prefix #fails, returns "default"
+ assert_nil root.namespace.prefix
+ assert_nil toadd.namespace.prefix
+ assert_nil new_node.namespace.prefix #fails, returns "default"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment