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

ruby-changes:36361

From: kou <ko1@a...>
Date: Sat, 15 Nov 2014 20:17:40 +0900 (JST)
Subject: [ruby-changes:36361] kou:r48442 (trunk): * test/rexml/test_document.rb

kou	2014-11-15 20:17:33 +0900 (Sat, 15 Nov 2014)

  New Revision: 48442

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

  Log:
    * test/rexml/test_document.rb
      (REXMLTests::TestDocument::EntityExpansionLimitTest): Use
      setup and teardown instead of ensure in test.

  Modified files:
    trunk/ChangeLog
    trunk/test/rexml/test_document.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 48441)
+++ ChangeLog	(revision 48442)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Nov 15 20:16:59 2014  Kouhei Sutou  <kou@c...>
+
+	* test/rexml/test_document.rb
+	  (REXMLTests::TestDocument::EntityExpansionLimitTest): Use
+	  setup and teardown instead of ensure in test.
+
 Sat Nov 15 20:11:34 2014  Kouhei Sutou  <kou@c...>
 
 	* test/rexml/test_document.rb (REXMLTests::TestDocument): Group
Index: test/rexml/test_document.rb
===================================================================
--- test/rexml/test_document.rb	(revision 48441)
+++ test/rexml/test_document.rb	(revision 48442)
@@ -33,6 +33,14 @@ EOF https://github.com/ruby/ruby/blob/trunk/test/rexml/test_document.rb#L33
     end
 
     class EntityExpansionLimitTest < Test::Unit::TestCase
+      def setup
+        @default_entity_expansion_limit = REXML::Security.entity_expansion_limit
+      end
+
+      def teardown
+        REXML::Security.entity_expansion_limit = @default_entity_expansion_limit
+      end
+
       XML_WITH_NESTED_ENTITY = <<EOF
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE member [
@@ -139,8 +147,6 @@ EOF https://github.com/ruby/ruby/blob/trunk/test/rexml/test_document.rb#L147
         assert_raise(RuntimeError) do
           doc.root.children.first.value
         end
-      ensure
-        REXML::Security.entity_expansion_limit = 10000
       end
 
       def test_entity_expansion_limit_for_parameter_entity
@@ -161,8 +167,6 @@ EOF https://github.com/ruby/ruby/blob/trunk/test/rexml/test_document.rb#L167
         assert_raise(REXML::ParseException) do
           REXML::Document.new(XML_WITH_NESTED_EMPTY_PARAMETER_ENTITY)
         end
-      ensure
-        REXML::Security.entity_expansion_limit = 10000
       end
     end
 

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

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