Sha256: 196e8c226bb0dcc976a2f858b53c3f9161b1b3ff3c2b10fa9050e32a01e3a221
Contents?: true
Size: 849 Bytes
Versions: 14
Compression:
Stored size: 849 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 should "normalize_opts should reject nil keys" do assert_raise { Stripe::Util.normalize_opts(nil) } assert_raise { Stripe::Util.normalize_opts(:api_key => nil) } end end end
Version data entries
14 entries across 14 versions & 1 rubygems