[前][次][番号順一覧][スレッド一覧]

ruby-changes:30226

From: kou <ko1@a...>
Date: Wed, 31 Jul 2013 21:32:35 +0900 (JST)
Subject: [ruby-changes:30226] kou:r42278 (trunk): * test/rexml/test_notationdecl_parsetest.rb: Remove setup because it

kou	2013-07-31 21:32:24 +0900 (Wed, 31 Jul 2013)

  New Revision: 42278

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42278

  Log:
    * test/rexml/test_notationdecl_parsetest.rb: Remove setup because it
      doesn't share anything with other tests.

  Modified files:
    trunk/ChangeLog
    trunk/test/rexml/test_notationdecl_parsetest.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42277)
+++ ChangeLog	(revision 42278)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Jul 31 21:31:49 2013  Kouhei Sutou  <kou@c...>
+
+	* test/rexml/test_notationdecl_parsetest.rb: Remove setup because it
+	  doesn't share anything with other tests.
+
 Wed Jul 31 21:24:55 2013  Kouhei Sutou  <kou@c...>
 
 	* test/rexml/test_attributes_mixin.rb: Remove a needless shebang.
Index: test/rexml/test_notationdecl_parsetest.rb
===================================================================
--- test/rexml/test_notationdecl_parsetest.rb	(revision 42277)
+++ test/rexml/test_notationdecl_parsetest.rb	(revision 42278)
@@ -2,20 +2,26 @@ 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 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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]