ruby-changes:30228
From: kou <ko1@a...>
Date: Wed, 31 Jul 2013 21:44:34 +0900 (JST)
Subject: [ruby-changes:30228] kou:r42280 (trunk): * test/rexml/test_notationdecl_parsetest.rb: Group tests.
kou 2013-07-31 21:44:24 +0900 (Wed, 31 Jul 2013) New Revision: 42280 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42280 Log: * test/rexml/test_notationdecl_parsetest.rb: Group tests. Modified files: trunk/ChangeLog trunk/test/rexml/test_notationdecl_parsetest.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 42279) +++ ChangeLog (revision 42280) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Jul 31 21:42:33 2013 Kouhei Sutou <kou@c...> + + * test/rexml/test_notationdecl_parsetest.rb: Group tests. + Wed Jul 31 21:37:51 2013 Kouhei Sutou <kou@c...> * test/rexml/test_notationdecl_mixin.rb (TestNotationDecl#test_name): Index: test/rexml/test_notationdecl_parsetest.rb =================================================================== --- test/rexml/test_notationdecl_parsetest.rb (revision 42279) +++ test/rexml/test_notationdecl_parsetest.rb (revision 42280) @@ -2,20 +2,6 @@ require 'test/unit' https://github.com/ruby/ruby/blob/trunk/test/rexml/test_notationdecl_parsetest.rb#L2 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::Tes https://github.com/ruby/ruby/blob/trunk/test/rexml/test_notationdecl_parsetest.rb#L15 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/