Sha256: 544304dcee9c47bd37b2b5ec995dbebbab631be07a818ede33f67bc7f80d13b5
Contents?: true
Size: 1.17 KB
Versions: 40
Compression:
Stored size: 1.17 KB
Contents
require 'spec_helper' class UtilClass include Twilio::REST::Utils end describe UtilClass do subject(:util) { UtilClass.new } it 'should convert a parameter name to a Twilio-style name' do expect(util.twilify('sms_url')).to eq('SmsUrl') end it 'should convert all parameter names to Twilio-style names' do untwilified = { :sms_url => 'someUrl', 'voiceFallbackUrl' => 'anotherUrl', 'Status_callback' => 'yetAnotherUrl' } twilified = { :SmsUrl => 'someUrl', :VoiceFallbackUrl => 'anotherUrl', :StatusCallback => 'yetAnotherUrl' } expect(util.twilify(untwilified)).to eq(twilified) end it 'should convert a Twilio-style name to a parameter name' do expect(util.detwilify('SmsUrl')).to eq('sms_url') end it 'should convert all Twilio-style names to parameter names' do untwilified = { :sms_url => 'someUrl', :voice_fallback_url => 'anotherUrl', :status_callback => 'yetAnotherUrl' } twilified = { :SmsUrl => 'someUrl', :VoiceFallbackUrl => 'anotherUrl', :StatusCallback => 'yetAnotherUrl' } expect(util.detwilify(twilified)).to eq(untwilified) end end
Version data entries
40 entries across 40 versions & 1 rubygems