summaryrefslogtreecommitdiff
path: root/test/rexml/test_notationdecl_parsetest.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rexml/test_notationdecl_parsetest.rb')
-rw-r--r--test/rexml/test_notationdecl_parsetest.rb32
1 files changed, 18 insertions, 14 deletions
diff --git a/test/rexml/test_notationdecl_parsetest.rb b/test/rexml/test_notationdecl_parsetest.rb
index 78787a41ab..2f0836c817 100644
--- a/test/rexml/test_notationdecl_parsetest.rb
+++ b/test/rexml/test_notationdecl_parsetest.rb
@@ -2,20 +2,6 @@ require 'test/unit'
require 'rexml/document'
class TestNotationDecl < Test::Unit::TestCase
- def test_name
- doctype = parse("<!NOTATION name PUBLIC 'urn:public-id'>")
- assert_equal("name", doctype.notation("name").name)
- end
-
- 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">
- INTERNAL_SUBSET
- assert(doctype.notation('n1'), "Testing notation n1")
- assert(doctype.notation('n2'), "Testing notation n2")
- end
-
private
def xml(internal_subset)
<<-XML
@@ -29,4 +15,22 @@ class TestNotationDecl < Test::Unit::TestCase
def parse(internal_subset)
REXML::Document.new(xml(internal_subset)).doctype
end
+
+ class TestCommon < self
+ def test_name
+ doctype = parse("<!NOTATION name PUBLIC 'urn:public-id'>")
+ assert_equal("name", doctype.notation("name").name)
+ end
+ end
+
+ class TestExternID < self
+ 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">
+ INTERNAL_SUBSET
+ assert(doctype.notation('n1'), "Testing notation n1")
+ assert(doctype.notation('n2'), "Testing notation n2")
+ end
+ end
end