diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2016-11-20 17:57:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-20 17:57:16 +0100 |
commit | 71117e1451f3fa74605059bc6f87b9282686f624 (patch) | |
tree | 852e8747830339662da6a2e71f17a08f0d6a8808 /activesupport/test/xml_mini/rexml_engine_test.rb | |
parent | 5aea0952e7cb445e614652e3cd9aba71a836eed0 (diff) | |
parent | 8e3901b5e6b4900cb4dd4cc1154180f42b51db2b (diff) | |
download | rails-71117e1451f3fa74605059bc6f87b9282686f624.tar.gz rails-71117e1451f3fa74605059bc6f87b9282686f624.tar.bz2 rails-71117e1451f3fa74605059bc6f87b9282686f624.zip |
Merge pull request #27111 from maclover7/jm-xmlmini
Refactor ActiveSupport::XMLMini test suite
Diffstat (limited to 'activesupport/test/xml_mini/rexml_engine_test.rb')
-rw-r--r-- | activesupport/test/xml_mini/rexml_engine_test.rb | 42 |
1 files changed, 12 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..085cf2caf7 100644 --- a/activesupport/test/xml_mini/rexml_engine_test.rb +++ b/activesupport/test/xml_mini/rexml_engine_test.rb @@ -1,44 +1,26 @@ -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 |