ruby-changes:18088
From: kou <ko1@a...>
Date: Tue, 7 Dec 2010 20:32:22 +0900 (JST)
Subject: [ruby-changes:18088] Ruby:r30109 (trunk): * test/rexml/test_doctype_mixin.rb: rename to ...
kou 2010-12-07 20:30:19 +0900 (Tue, 07 Dec 2010) New Revision: 30109 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30109 Log: * test/rexml/test_doctype_mixin.rb: rename to ... * test/rexml/test_doctype.rb: ... this to remove needless name. Added files: trunk/test/rexml/test_doctype.rb Removed files: trunk/test/rexml/test_doctype_mixin.rb Modified files: trunk/ChangeLog Index: ChangeLog =================================================================== --- ChangeLog (revision 30108) +++ ChangeLog (revision 30109) @@ -1,3 +1,8 @@ +Tue Dec 7 20:29:23 2010 Kouhei Sutou <kou@c...> + + * test/rexml/test_doctype_mixin.rb: rename to ... + * test/rexml/test_doctype.rb: ... this to remove needless name. + Tue Dec 7 17:03:16 2010 Shugo Maeda <shugo@r...> * lib/net/imap.rb (xlist): supported the XLIST command, which is an Index: test/rexml/test_doctype_mixin.rb =================================================================== --- test/rexml/test_doctype_mixin.rb (revision 30108) +++ test/rexml/test_doctype_mixin.rb (revision 30109) @@ -1,67 +0,0 @@ -#! /usr/local/bin/ruby - - -require 'test/unit' -require 'rexml/document' - -class TestDoctype < Test::Unit::TestCase - - def setup - @sysid = "urn:x-test:sysid1" - @notid1 = "urn:x-test:notation1" - @notid2 = "urn:x-test:notation2" - document_string1 = <<-"XMLEND" - <!DOCTYPE r SYSTEM "#{@sysid}" [ - <!NOTATION n1 SYSTEM "#{@notid1}"> - <!NOTATION n2 SYSTEM "#{@notid2}"> - ]> - <r/> - XMLEND - @doctype1 = REXML::Document.new(document_string1).doctype - - @pubid = "TEST_ID" - document_string2 = <<-"XMLEND" - <!DOCTYPE r PUBLIC "#{@pubid}"> - <r/> - XMLEND - @doctype2 = REXML::Document.new(document_string2).doctype - - document_string3 = <<-"XMLEND" - <!DOCTYPE r PUBLIC "#{@pubid}" "#{@sysid}"> - <r/> - XMLEND - @doctype3 = REXML::Document.new(document_string3).doctype - - end - - def test_public - assert_equal(nil, @doctype1.public) - assert_equal(@pubid, @doctype2.public) - assert_equal(@pubid, @doctype3.public) - end - - def test_system - assert_equal(@sysid, @doctype1.system) - assert_equal(nil, @doctype2.system) - assert_equal(@sysid, @doctype3.system) - end - - def test_notation - assert_equal(@notid1, @doctype1.notation("n1").system) - assert_equal(@notid2, @doctype1.notation("n2").system) - end - - def test_notations - notations = @doctype1.notations - assert_equal(2, notations.length) - assert_equal(@notid1, find_notation(notations, "n1").system) - assert_equal(@notid2, find_notation(notations, "n2").system) - end - - def find_notation(notations, name) - notations.find { |notation| - name == notation.name - } - end - -end Index: test/rexml/test_doctype.rb =================================================================== --- test/rexml/test_doctype.rb (revision 0) +++ test/rexml/test_doctype.rb (revision 30109) @@ -0,0 +1,67 @@ +#! /usr/local/bin/ruby + + +require 'test/unit' +require 'rexml/document' + +class TestDoctype < Test::Unit::TestCase + + def setup + @sysid = "urn:x-test:sysid1" + @notid1 = "urn:x-test:notation1" + @notid2 = "urn:x-test:notation2" + document_string1 = <<-"XMLEND" + <!DOCTYPE r SYSTEM "#{@sysid}" [ + <!NOTATION n1 SYSTEM "#{@notid1}"> + <!NOTATION n2 SYSTEM "#{@notid2}"> + ]> + <r/> + XMLEND + @doctype1 = REXML::Document.new(document_string1).doctype + + @pubid = "TEST_ID" + document_string2 = <<-"XMLEND" + <!DOCTYPE r PUBLIC "#{@pubid}"> + <r/> + XMLEND + @doctype2 = REXML::Document.new(document_string2).doctype + + document_string3 = <<-"XMLEND" + <!DOCTYPE r PUBLIC "#{@pubid}" "#{@sysid}"> + <r/> + XMLEND + @doctype3 = REXML::Document.new(document_string3).doctype + + end + + def test_public + assert_equal(nil, @doctype1.public) + assert_equal(@pubid, @doctype2.public) + assert_equal(@pubid, @doctype3.public) + end + + def test_system + assert_equal(@sysid, @doctype1.system) + assert_equal(nil, @doctype2.system) + assert_equal(@sysid, @doctype3.system) + end + + def test_notation + assert_equal(@notid1, @doctype1.notation("n1").system) + assert_equal(@notid2, @doctype1.notation("n2").system) + end + + def test_notations + notations = @doctype1.notations + assert_equal(2, notations.length) + assert_equal(@notid1, find_notation(notations, "n1").system) + assert_equal(@notid2, find_notation(notations, "n2").system) + end + + def find_notation(notations, name) + notations.find { |notation| + name == notation.name + } + end + +end Property changes on: test/rexml/test_doctype.rb ___________________________________________________________________ Added: svn:eol-style + LF -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/