summaryrefslogtreecommitdiff
path: root/test/rexml
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 /test/rexml
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
Diffstat (limited to 'test/rexml')
-rw-r--r--test/rexml/test_document.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/rexml/test_document.rb b/test/rexml/test_document.rb
index a428e55..567b357 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