Skip to content

Commit

Permalink
Failed test which demonstrates that node.to_xml does not respect AS_X…
Browse files Browse the repository at this point in the history
…ML save option
  • Loading branch information
mironov authored and tenderlove committed Nov 17, 2011
1 parent 7ec7524 commit 9ed7f8b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/xml/test_node.rb
Expand Up @@ -874,7 +874,7 @@ def test_namespace
<b:div>hello b</b:div>
<c:div>hello c</c:div>
<div>hello moon</div>
</y>
</y>
</x>
EOF
set = xml.search("//y/*")
Expand Down Expand Up @@ -937,6 +937,15 @@ def test_blank
doc = Nokogiri::XML('')
assert_equal false, doc.blank?
end

def test_to_xml_allows_to_serialize_with_as_xml_save_option
xml = Nokogiri::XML("<root><ul><li>Hello world</li></ul></root>")
set = xml.search("//ul")
node = set.first

assert_no_match("<ul>\n <li>", xml.to_xml(:save_with => XML::Node::SaveOptions::AS_XML))
assert_no_match("<ul>\n <li>", node.to_xml(:save_with => XML::Node::SaveOptions::AS_XML))
end
end
end
end

0 comments on commit 9ed7f8b

Please sign in to comment.