summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-15 11:17:33 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-15 11:17:33 +0000
commita4a2fbdf6465b879977dea2d0105682c09a639c7 (patch)
treed248abecc36635f09a40a9f78dc305be02cc573b
parentdd547e1b22188d23c4b7d3fc260cf71f8de075aa (diff)
* test/rexml/test_document.rb
(REXMLTests::TestDocument::EntityExpansionLimitTest): Use setup and teardown instead of ensure in test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--test/rexml/test_document.rb12
2 files changed, 14 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 5dc0edb3b2a..f3ff49c9325 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Nov 15 20:16:59 2014 Kouhei Sutou <kou@cozmixng.org>
+
+ * 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@cozmixng.org>
* test/rexml/test_document.rb (REXMLTests::TestDocument): Group
diff --git a/test/rexml/test_document.rb b/test/rexml/test_document.rb
index a428e55dd4a..567b357480d 100644
--- a/test/rexml/test_document.rb
+++ b/test/rexml/test_document.rb
@@ -33,6 +33,14 @@ EOF
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
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
assert_raise(REXML::ParseException) do
REXML::Document.new(XML_WITH_NESTED_EMPTY_PARAMETER_ENTITY)
end
- ensure
- REXML::Security.entity_expansion_limit = 10000
end
end