diff options
Diffstat (limited to 'test/rexml')
-rw-r--r-- | test/rexml/test_notationdecl_parsetest.rb | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/test/rexml/test_notationdecl_parsetest.rb b/test/rexml/test_notationdecl_parsetest.rb index a1fa9fb67e..547195d47b 100644 --- a/test/rexml/test_notationdecl_parsetest.rb +++ b/test/rexml/test_notationdecl_parsetest.rb @@ -2,20 +2,26 @@ require 'test/unit' require 'rexml/document' class TestNotationDecl < Test::Unit::TestCase - def setup - doc_string = <<-'XMLEND' - <!DOCTYPE r SYSTEM "urn:x-henrikmartensson:test" [ + def test_notation + doctype = parse(<<-INTERNAL_SUBSET) <!NOTATION n1 PUBLIC "-//HM//NOTATION TEST1//EN" 'urn:x-henrikmartensson.org:test5'> <!NOTATION n2 PUBLIC '-//HM//NOTATION TEST2//EN' "urn:x-henrikmartensson.org:test6"> - ]> - <r/> - XMLEND - @doctype = REXML::Document.new(doc_string).doctype + INTERNAL_SUBSET + assert(doctype.notation('n1'), "Testing notation n1") + assert(doctype.notation('n2'), "Testing notation n2") end - def test_notation - assert(@doctype.notation('n1'), "Testing notation n1") - assert(@doctype.notation('n2'), "Testing notation n2") + private + def xml(internal_subset) + <<-XML +<!DOCTYPE r SYSTEM "urn:x-henrikmartensson:test" [ +#{internal_subset} +]> +<r/> + XML end + def parse(internal_subset) + REXML::Document.new(xml(internal_subset)).doctype + end end |