Sha256: a912255c5b7d9650975b93b12b42b16e69edfa1b32bb03e23cbaaf99ae5edb73

Contents?: true

Size: 742 Bytes

Versions: 38

Compression:

Stored size: 742 Bytes

Contents

require File.expand_path('../../../test_helper', __FILE__)

module Maestrano
  module API
    class UtilTest < Test::Unit::TestCase
      should "symbolize_names should convert names to symbols" do
        start = {
          'foo' => 'bar',
          'array' => [{ 'foo' => 'bar' }],
          'nested' => {
            1 => 2,
            :symbol => 9,
            'string' => nil
          }
        }
        finish = {
          :foo => 'bar',
          :array => [{ :foo => 'bar' }],
          :nested => {
            1 => 2,
            :symbol => 9,
            :string => nil
          }
        }

        symbolized = Maestrano::API::Util.symbolize_names(start)
        assert_equal(finish, symbolized)
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 2 rubygems

Version Path
maestrano-0.12.1 test/maestrano/api/util_test.rb
maestrano-0.12.0 test/maestrano/api/util_test.rb
maestrano-0.11.0 test/maestrano/api/util_test.rb
maestrano-0.10.0 test/maestrano/api/util_test.rb
maestrano-0.9.2 test/maestrano/api/util_test.rb
maestrano-0.9.1 test/maestrano/api/util_test.rb
maestrano-0.9.0 test/maestrano/api/util_test.rb
maestrano-ruby-test-0.8.3 test/maestrano/api/util_test.rb
maestrano-0.8.2 test/maestrano/api/util_test.rb
maestrano-0.8.1 test/maestrano/api/util_test.rb
maestrano-0.8.0 test/maestrano/api/util_test.rb
maestrano-0.7.0 test/maestrano/api/util_test.rb
maestrano-0.6.0 test/maestrano/api/util_test.rb
maestrano-0.5.0 test/maestrano/api/util_test.rb
maestrano-0.4.0 test/maestrano/api/util_test.rb
maestrano-0.3.0 test/maestrano/api/util_test.rb
maestrano-0.2.0 test/maestrano/api/util_test.rb
maestrano-0.1.0 test/maestrano/api/util_test.rb