summaryrefslogtreecommitdiff
path: root/test/rexml
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-31 12:44:24 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-31 12:44:24 +0000
commit3e04769926f302577c10310ec629b2f5c4a84d8d (patch)
tree9036128cb6c68d495091f2b7323e07b5c407803f /test/rexml
parent1251f51ee7ca784d923ad1400778885631063292 (diff)
* test/rexml/test_notationdecl_parsetest.rb: Group tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rexml')
-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 78787a4..2f0836c 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