Sha256: c12a35f36dcd2814fa12648234564375e31fd3a2e86dd3ff00cac78e3c8403e5
Contents?: true
Size: 1.19 KB
Versions: 13
Compression:
Stored size: 1.19 KB
Contents
require 'spec_helper' describe Twilio do describe 'prefixed_collapsible_map' do it 'should serialize nil' do actual = Twilio.prefixed_collapsible_map(nil, 'Prefix') expect(actual).to eq({}) end it 'should serialize a single key' do actual = Twilio.prefixed_collapsible_map({ 'foo' => 'bar' }, 'Prefix') expect(actual).to eq({ 'Prefix.foo' => 'bar' }) end it 'should serialize nested key' do actual = Twilio.prefixed_collapsible_map({ 'foo' => { 'bar' => 'baz' } }, 'Prefix') expect(actual).to eq({ 'Prefix.foo.bar' => 'baz' }) end it 'should serialize multiple keys' do actual = Twilio.prefixed_collapsible_map({ 'watson' => { 'language' => 'en', 'alice' => 'bob' }, 'foo' => 'bar' }, 'Prefix') expect(actual).to eq({ 'Prefix.watson.language' => 'en', 'Prefix.watson.alice' => 'bob', 'Prefix.foo' => 'bar' }) end it 'should serialize list' do actual = Twilio.prefixed_collapsible_map(['foo', 'bar'], 'Prefix') expect(actual).to eq({}) end end end
Version data entries
13 entries across 13 versions & 1 rubygems