Sha256: fddd1e126b0fd9d638f455de8385a1c0c84c0763f3bff8d6f8c0e57febcaf44b

Contents?: true

Size: 779 Bytes

Versions: 6

Compression:

Stored size: 779 Bytes

Contents

require 'helper'
require 'peddler/structured_list'

class StructuredListTest < MiniTest::Test
  def setup
    @list = Peddler::StructuredList.new('OrderStatus', 'Status')
  end

  def test_builds_a_structured_list_for_a_single_value
    exp = { 'OrderStatus.Status.1' => 'foo' }
    assert_equal exp, @list.build('foo')
  end

  def test_builds_a_structured_list_for_an_array_of_values
    exp = { 'OrderStatus.Status.1' => 'foo', 'OrderStatus.Status.2' => 'bar' }
    assert_equal exp, @list.build(%w(foo bar))
  end

  def test_handles_more_than_two_keys
    list = Peddler::StructuredList.new('QueryList', 'Query', '1', 'FilterOptions', 'FilterOption')
    exp = { 'QueryList.Query.1.FilterOptions.FilterOption.1' => 'foo' }

    assert_equal exp, list.build('foo')
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
peddler-0.7.7 test/unit/peddler/test_structured_list.rb
peddler-0.7.6 test/unit/peddler/test_structured_list.rb
peddler-0.7.5 test/unit/peddler/test_structured_list.rb
peddler-0.7.3 test/unit/peddler/test_structured_list.rb
peddler-0.7.2 test/unit/peddler/test_structured_list.rb
peddler-0.7.1 test/unit/peddler/test_structured_list.rb