Sha256: fa47363f204b565a8ed5128dd47ac7a27f4b10bf1d8da6ecf44e4d8006a54e88

Contents?: true

Size: 672 Bytes

Versions: 5

Compression:

Stored size: 672 Bytes

Contents

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

module Rainforest
  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 = Rainforest::Util.symbolize_names(start)
      assert_equal(finish, symbolized)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rainforest-1.0.7 test/rainforest/util_test.rb
rainforest-1.0.6 test/rainforest/util_test.rb
rainforest-1.0.5 test/rainforest/util_test.rb
rainforest-1.0.4 test/rainforest/util_test.rb
rainforest-1.0.3 test/rainforest/util_test.rb