summaryrefslogtreecommitdiff
path: root/test/rexml/test_document.rb
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-27 12:24:31 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-27 12:24:31 +0000
commit3b6d093451565c80d36c791ff6ac9cbc5918d287 (patch)
tree1c6a9675ea0eeb169707c4f82997cde3a5f5dca2 /test/rexml/test_document.rb
parent20514a08936861205e21c80973b532d6af26c139 (diff)
* lib/rexml/security.rb (REXML::Security): create.
* lib/rexml/rexml.rb: move entity_expansion_limit and entity_expansion_text_limit accessors to ... * lib/rexml/security.rb: ... here. * lib/rexml/document.rb: use REXML::Security. * lib/rexml/text.rb: use REXML::Security. * test/rexml/test_document.rb: use REXML::Security. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rexml/test_document.rb')
-rw-r--r--test/rexml/test_document.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/rexml/test_document.rb b/test/rexml/test_document.rb
index 3ef584c290..cec9452373 100644
--- a/test/rexml/test_document.rb
+++ b/test/rexml/test_document.rb
@@ -65,24 +65,24 @@ EOF
assert_raise(RuntimeError) do
doc.root.children.first.value
end
- REXML::Document.entity_expansion_limit = 100
- assert_equal(100, REXML::Document.entity_expansion_limit)
+ REXML::Security.entity_expansion_limit = 100
+ assert_equal(100, REXML::Security.entity_expansion_limit)
doc = REXML::Document.new(XML_WITH_NESTED_ENTITY)
assert_raise(RuntimeError) do
doc.root.children.first.value
end
assert_equal(101, doc.entity_expansion_count)
- REXML::Document.entity_expansion_limit = 4
+ 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)
- REXML::Document.entity_expansion_limit = 3
+ REXML::Security.entity_expansion_limit = 3
doc = REXML::Document.new(XML_WITH_4_ENTITY_EXPANSION)
assert_raise(RuntimeError) do
doc.root.children.first.value
end
ensure
- REXML::Document.entity_expansion_limit = 10000
+ REXML::Security.entity_expansion_limit = 10000
end
def test_tag_in_cdata_with_not_ascii_only_but_ascii8bit_encoding_source