1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
kou 2014-11-15 11:17:33 +00:00
parent dd547e1b22
commit a4a2fbdf64
2 changed files with 14 additions and 4 deletions

View file

@ -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

View file

@ -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