require 'test/unit' require 'rexml/document' class TestNotationDecl < Test::Unit::TestCase private def xml(internal_subset) <<-XML XML end def parse(internal_subset) REXML::Document.new(xml(internal_subset)).doctype end class TestCommon < self def test_name doctype = parse("") assert_equal("name", doctype.notation("name").name) end end class TestExternID < self class TestPublic < self class TestPublicIDLiteral < self def test_single_quote doctype = parse(<<-INTERNAL_SUBSET) INTERNAL_SUBSET assert_equal("pubilc-id-literal", doctype.notation("name").public) end def test_double_quote doctype = parse(<<-INTERNAL_SUBSET) INTERNAL_SUBSET assert_equal("pubilc-id-literal", doctype.notation("name").public) end end class TestSystemLiteral < self def test_single_quote doctype = parse(<<-INTERNAL_SUBSET) INTERNAL_SUBSET assert_equal("system-literal", doctype.notation("name").system) end def test_double_quote doctype = parse(<<-INTERNAL_SUBSET) INTERNAL_SUBSET assert_equal("system-literal", doctype.notation("name").system) end end end end end