require "test/unit" require "rexml/document" class TestParseDocumentTypeDeclaration < Test::Unit::TestCase private def xml(internal_subset) <<-XML XML end def parse(internal_subset) REXML::Document.new(xml(internal_subset)).doctype end class TestMixed < self def test_entity_element doctype = parse(<<-INTERNAL_SUBSET) INTERNAL_SUBSET assert_equal([REXML::Entity, REXML::ElementDecl], doctype.children.collect(&:class)) end def test_attlist_entity doctype = parse(<<-INTERNAL_SUBSET) INTERNAL_SUBSET assert_equal([REXML::AttlistDecl, REXML::Entity], doctype.children.collect(&:class)) end def test_notation_attlist doctype = parse(<<-INTERNAL_SUBSET) INTERNAL_SUBSET assert_equal([REXML::NotationDecl, REXML::AttlistDecl], doctype.children.collect(&:class)) end end end