require "xml" require 'test/unit' class TC_XML_HTMLParser < Test::Unit::TestCase def setup() @xp = XML::HTMLParser.new() assert_not_nil(@xp) str = '
Hello# cant figure our why or how, so this skips it if there hello = hello.child if hello.name == "p" assert_instance_of XML::Node, hello assert_equal 'Hello', hello.content br = hello.next assert_instance_of XML::Node, br assert_equal 'br', br.name world = br.next assert_instance_of XML::Node, world assert_equal 'World', world.content end def test_libxml_html_parser_context() doc = @xp.parse assert_instance_of(XML::Document, doc) assert_instance_of(XML::Parser::Context, @xp.context) assert @xp.context.html? end end # TC_XML_HTMLParser