File: rexml_array_branch_test.rb

package info (click to toggle)
ruby-multi-xml 0.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 472 kB
  • sloc: ruby: 2,822; sh: 4; makefile: 2
file content (16 lines) | stat: -rw-r--r-- 399 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require "test_helper"

# Tests REXML parser add_to_hash behavior
class RexmlArrayBranchTest < Minitest::Test
  cover "MultiXml*"

  def test_add_to_hash_wraps_array_value_in_array
    require "multi_xml/parsers/rexml"

    hash = {}
    value = %w[item1 item2]
    result = MultiXml::Parsers::Rexml.send(:add_to_hash, hash, "key", value)

    assert_equal [%w[item1 item2]], result["key"]
  end
end