aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/xml_mini/rexml_engine_test.rb
blob: 0f4e690746818dcf46b50b9ba1d539b608a146c1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require "abstract_unit"
require "active_support/xml_mini"
require_relative "./common"

class REXMLEngineTest < ActiveSupport::TestCase
  include CommonXMLMiniAdapterTest

  def test_default_is_rexml
    assert_equal ActiveSupport::XmlMini_REXML, ActiveSupport::XmlMini.backend
  end

  def test_parse_from_empty_string
    assert_equal({}, ActiveSupport::XmlMini.parse(""))
  end

  def test_parse_from_frozen_string
    xml_string = "<root></root>".freeze
    assert_equal({ "root" => {} }, ActiveSupport::XmlMini.parse(xml_string))
  end

  private

  def adapter_name
    "REXML"
  end

  def expansion_attack_error
    RuntimeError
  end
end