Skip to content

Instantly share code, notes, and snippets.

@vladzloteanu
Created May 6, 2010 12:04
Show Gist options
  • Save vladzloteanu/392060 to your computer and use it in GitHub Desktop.
Save vladzloteanu/392060 to your computer and use it in GitHub Desktop.
def test_auto_closing_tags
reader = Nokogiri::XML::Reader.from_memory(<<-eoxml)
<xml><city>Paris</city><state/></xml>
eoxml
assert_equal [false, false, nil, nil, true, nil],
reader.map{|node| node.empty_element? if node.node_type == Nokogiri::XML::Node::ELEMENT_NODE}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment