aboutsummaryrefslogtreecommitdiffstats
path: root/test/rexml
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-15 11:40:47 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-15 11:40:47 +0000
commita5406b873c7519d8bfb5982e7905e71977b846a9 (patch)
tree4b888f05d079e4ece06cea43ddef5e0e3b270d80 /test/rexml
parenta895babbff609332d00b81f56beb2191b98eb248 (diff)
downloadruby-a5406b873c7519d8bfb5982e7905e71977b846a9.tar.gz
* test/rexml/test_document.rb
(REXMLTests::TestDocument::EntityExpansionLimitTest): Use one test method for one test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rexml')
-rw-r--r--test/rexml/test_document.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/rexml/test_document.rb b/test/rexml/test_document.rb
index 567b357480..8f37b2f12b 100644
--- a/test/rexml/test_document.rb
+++ b/test/rexml/test_document.rb
@@ -114,7 +114,7 @@ EOF
</member>
EOF
- def test_entity_expansion_limit
+ def test_general_entity_have_value
doc = REXML::Document.new(XML_WITH_NESTED_ENTITY)
assert_raise(RuntimeError) do
doc.root.children.first.value
@@ -126,7 +126,9 @@ EOF
doc.root.children.first.value
end
assert_equal(101, doc.entity_expansion_count)
+ end
+ def test_general_entity_empty_value
doc = REXML::Document.new(XML_WITH_NESTED_EMPTY_ENTITY)
assert_raise(RuntimeError) do
doc.root.children.first.value
@@ -138,7 +140,9 @@ EOF
doc.root.children.first.value
end
assert_equal(101, doc.entity_expansion_count)
+ end
+ def test_general_entity_with_default_entity
REXML::Security.entity_expansion_limit = 4
doc = REXML::Document.new(XML_WITH_4_ENTITY_EXPANSION)
assert_equal("\na\na a\n<\n", doc.root.children.first.value)
@@ -149,7 +153,7 @@ EOF
end
end
- def test_entity_expansion_limit_for_parameter_entity
+ def test_parameter_entity_have_value
assert_raise(REXML::ParseException) do
REXML::Document.new(XML_WITH_NESTED_PARAMETER_ENTITY)
end
@@ -158,7 +162,9 @@ EOF
assert_raise(REXML::ParseException) do
REXML::Document.new(XML_WITH_NESTED_PARAMETER_ENTITY)
end
+ end
+ def test_parameter_entity_empty_value
assert_raise(REXML::ParseException) do
REXML::Document.new(XML_WITH_NESTED_EMPTY_PARAMETER_ENTITY)
end