diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-12-29 02:18:38 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-29 02:18:38 -0500 |
commit | eb6a6141a66e052deb58580448d7c0fa6aa675ba (patch) | |
tree | 0017a57044ec8e466c97cc6b7879d39caa6c1ffa /activesupport/test/xml_mini/rexml_engine_test.rb | |
parent | 447e1a48811fa053e8bef954376d1ad47bdb5cef (diff) | |
parent | fcec126eaa4f835c837bc75efa78008667b2ec5b (diff) | |
download | rails-eb6a6141a66e052deb58580448d7c0fa6aa675ba.tar.gz rails-eb6a6141a66e052deb58580448d7c0fa6aa675ba.tar.bz2 rails-eb6a6141a66e052deb58580448d7c0fa6aa675ba.zip |
Merge branch 'master' into clear_all_environments_log_by_default
Diffstat (limited to 'activesupport/test/xml_mini/rexml_engine_test.rb')
-rw-r--r-- | activesupport/test/xml_mini/rexml_engine_test.rb | 41 |
1 files changed, 11 insertions, 30 deletions
diff --git a/activesupport/test/xml_mini/rexml_engine_test.rb b/activesupport/test/xml_mini/rexml_engine_test.rb index dc62f3f671..c51f0d3c20 100644 --- a/activesupport/test/xml_mini/rexml_engine_test.rb +++ b/activesupport/test/xml_mini/rexml_engine_test.rb @@ -1,44 +1,25 @@ -require "abstract_unit" -require "active_support/xml_mini" +require_relative "xml_mini_engine_test" -class REXMLEngineTest < ActiveSupport::TestCase +class REXMLEngineTest < XMLMiniEngineTest def test_default_is_rexml assert_equal ActiveSupport::XmlMini_REXML, ActiveSupport::XmlMini.backend end - def test_set_rexml_as_backend - ActiveSupport::XmlMini.backend = "REXML" - assert_equal ActiveSupport::XmlMini_REXML, ActiveSupport::XmlMini.backend - end - - def test_parse_from_io - ActiveSupport::XmlMini.backend = "REXML" - io = StringIO.new(<<-eoxml) - <root> - good - <products> - hello everyone - </products> - morning - </root> - eoxml - hash = ActiveSupport::XmlMini.parse(io) - assert hash.has_key?("root") - assert hash["root"].has_key?("products") - assert_match "good", hash["root"]["__content__"] - products = hash["root"]["products"] - assert products.has_key?("__content__") - assert_match "hello everyone", products["__content__"] - end - def test_parse_from_empty_string - ActiveSupport::XmlMini.backend = "REXML" assert_equal({}, ActiveSupport::XmlMini.parse("")) end def test_parse_from_frozen_string - ActiveSupport::XmlMini.backend = "REXML" xml_string = "<root></root>".freeze assert_equal({ "root" => {} }, ActiveSupport::XmlMini.parse(xml_string)) end + + private + def engine + "REXML" + end + + def expansion_attack_error + RuntimeError + end end |