Sha256: 8c8b19d31e97a039169d4d9447185bc9609a09ffff0bf71ef8768f4b2eddaabb

Contents?: true

Size: 661 Bytes

Versions: 10

Compression:

Stored size: 661 Bytes

Contents

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

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
stripe-1.16.0 test/stripe/util_test.rb
stripe-1.15.0 test/stripe/util_test.rb
stripe-1.14.0 test/stripe/util_test.rb
stripe-1.13.0 test/stripe/util_test.rb
stripe-1.12.0 test/stripe/util_test.rb
stripe-1.11.0 test/stripe/util_test.rb
stripe-1.10.1 test/stripe/util_test.rb
stripe-1.10.0 test/stripe/util_test.rb
stripe-1.9.9 test/stripe/util_test.rb
stripe-1.8.8 test/stripe/util_test.rb