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 committed Aug 9, 2011
1 parent 52c76e0 commit 7c0b67f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/xml/test_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,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 @@ -917,6 +917,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 7c0b67f

Please sign in to comment.