mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-05 00:02:50 -04:00
30 lines
662 B
Ruby
30 lines
662 B
Ruby
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
|