2017-07-09 08:06:36 -04:00
|
|
|
# frozen_string_literal: true
|
2017-07-10 09:39:13 -04:00
|
|
|
|
2016-11-20 10:09:20 -05:00
|
|
|
require_relative "xml_mini_engine_test"
|
2009-03-09 20:27:39 -04:00
|
|
|
|
2016-11-20 10:09:20 -05:00
|
|
|
class REXMLEngineTest < XMLMiniEngineTest
|
2016-11-19 10:59:24 -05:00
|
|
|
def test_default_is_rexml
|
2015-01-04 16:57:43 -05:00
|
|
|
assert_equal ActiveSupport::XmlMini_REXML, ActiveSupport::XmlMini.backend
|
2009-03-09 20:27:39 -04:00
|
|
|
end
|
2009-05-17 11:37:30 -04:00
|
|
|
|
2016-05-21 08:14:22 -04:00
|
|
|
def test_parse_from_empty_string
|
|
|
|
assert_equal({}, ActiveSupport::XmlMini.parse(""))
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_parse_from_frozen_string
|
2018-02-27 23:33:37 -05:00
|
|
|
xml_string = "<root></root>"
|
2016-08-16 03:30:11 -04:00
|
|
|
assert_equal({ "root" => {} }, ActiveSupport::XmlMini.parse(xml_string))
|
2009-05-17 11:37:30 -04:00
|
|
|
end
|
2016-11-19 10:59:24 -05:00
|
|
|
|
|
|
|
private
|
2016-11-20 09:06:17 -05:00
|
|
|
def engine
|
|
|
|
"REXML"
|
|
|
|
end
|
2016-11-19 10:59:24 -05:00
|
|
|
|
2016-11-20 09:06:17 -05:00
|
|
|
def expansion_attack_error
|
|
|
|
RuntimeError
|
|
|
|
end
|
2009-03-09 20:27:39 -04:00
|
|
|
end
|