require 'test/unit' require 'rexml/document' class TestNotationDecl < Test::Unit::TestCase def test_name doctype = parse("") assert_equal("name", doctype.notation("name").name) end def test_notation doctype = parse(<<-INTERNAL_SUBSET) INTERNAL_SUBSET assert(doctype.notation('n1'), "Testing notation n1") assert(doctype.notation('n2'), "Testing notation n2") end private def xml(internal_subset) <<-XML XML end def parse(internal_subset) REXML::Document.new(xml(internal_subset)).doctype end end