From a5406b873c7519d8bfb5982e7905e71977b846a9 Mon Sep 17 00:00:00 2001 From: kou Date: Sat, 15 Nov 2014 11:40:47 +0000 Subject: * 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 --- test/rexml/test_document.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'test/rexml') 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 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 -- cgit v1.2.1