test/twilio_spec.rb in twilio-ruby-3.4.1 vs test/twilio_spec.rb in twilio-ruby-3.4.2
- old
+ new
@@ -14,55 +14,60 @@
twilio.instance_variable_get('@auth_token').should == 'someToken'
end
it 'should set up the proper default http ssl connection' do
twilio = Twilio::REST::Client.new('someSid', 'someToken')
- twilio.instance_variable_get('@connection').address.should == 'api.twilio.com'
- twilio.instance_variable_get('@connection').port.should == 443
- twilio.instance_variable_get('@connection').use_ssl?.should == true
+ connection = twilio.instance_variable_get('@connection')
+ connection.address.should == 'api.twilio.com'
+ connection.port.should == 443
+ connection.use_ssl?.should == true
end
it 'should set up the requested ssl verification ca_file if provided' do
twilio = Twilio::REST::Client.new('someSid', 'someToken', :ssl_ca_file => '/path/to/ca/file')
connection = twilio.instance_variable_get('@connection')
connection.ca_file.should == '/path/to/ca/file'
end
it 'should set up the proper http ssl connection when a different domain is given' do
twilio = Twilio::REST::Client.new('someSid', 'someToken', :host => 'api.faketwilio.com')
- twilio.instance_variable_get('@connection').address.should == 'api.faketwilio.com'
- twilio.instance_variable_get('@connection').port.should == 443
- twilio.instance_variable_get('@connection').use_ssl?.should == true
+ connection = twilio.instance_variable_get('@connection')
+ connection.address.should == 'api.faketwilio.com'
+ connection.port.should == 443
+ connection.use_ssl?.should == true
end
it 'should adjust the open and read timeouts on the underlying Net::HTTP object when asked' do
timeout = rand(30)
twilio = Twilio::REST::Client.new('someSid', 'someToken', :timeout => timeout)
- twilio.instance_variable_get('@connection').port.should == 443
- twilio.instance_variable_get('@connection').use_ssl?.should == true
- twilio.instance_variable_get('@connection').open_timeout.should == timeout
- twilio.instance_variable_get('@connection').read_timeout.should == timeout
+ connection = twilio.instance_variable_get('@connection')
+ connection.port.should == 443
+ connection.use_ssl?.should == true
+ connection.open_timeout.should == timeout
+ connection.read_timeout.should == timeout
end
it 'should set up the proper http ssl connection when a proxy_host is given' do
twilio = Twilio::REST::Client.new('someSid', 'someToken', :host => 'api.faketwilio.com', :proxy_addr => 'localhost')
- twilio.instance_variable_get('@connection').proxy?.should == true
- twilio.instance_variable_get('@connection').proxy_address.should == 'localhost'
- twilio.instance_variable_get('@connection').proxy_port.should == 80
- twilio.instance_variable_get('@connection').address.should == 'api.faketwilio.com'
- twilio.instance_variable_get('@connection').port.should == 443
- twilio.instance_variable_get('@connection').use_ssl?.should == true
+ connection = twilio.instance_variable_get('@connection')
+ connection.proxy?.should == true
+ connection.proxy_address.should == 'localhost'
+ connection.proxy_port.should == 80
+ connection.address.should == 'api.faketwilio.com'
+ connection.port.should == 443
+ connection.use_ssl?.should == true
end
it 'should set up the proper http ssl connection when a proxy_host and proxy_port are given' do
twilio = Twilio::REST::Client.new('someSid', 'someToken', :host => 'api.faketwilio.com', :proxy_addr => 'localhost', :proxy_port => 13128)
- twilio.instance_variable_get('@connection').proxy?.should == true
- twilio.instance_variable_get('@connection').proxy_address.should == 'localhost'
- twilio.instance_variable_get('@connection').proxy_port.should == 13128
- twilio.instance_variable_get('@connection').address.should == 'api.faketwilio.com'
- twilio.instance_variable_get('@connection').port.should == 443
- twilio.instance_variable_get('@connection').use_ssl?.should == true
+ connection = twilio.instance_variable_get('@connection')
+ connection.proxy?.should == true
+ connection.proxy_address.should == 'localhost'
+ connection.proxy_port.should == 13128
+ connection.address.should == 'api.faketwilio.com'
+ connection.port.should == 443
+ connection.use_ssl?.should == true
end
it 'should set up an accounts resources object' do
twilio = Twilio::REST::Client.new('someSid', 'someToken')
twilio.respond_to?(:accounts).should == true
@@ -162,13 +167,13 @@
call = Twilio::REST::Call.new('someUri', 'someClient')
call.respond_to?(:recordings).should == true
call.recordings.instance_variable_get('@uri').should == 'someUri/Recordings'
end
- it 'should set up a recordings resources object' do
+ it 'should set up a notifications resources object' do
call = Twilio::REST::Call.new('someUri', 'someClient')
- call.respond_to?(:transcriptions).should == true
- call.transcriptions.instance_variable_get('@uri').should == 'someUri/Transcriptions'
+ call.respond_to?(:notifications).should == true
+ call.notifications.instance_variable_get('@uri').should == 'someUri/Notifications'
end
end
describe Twilio::REST::Conference do
it 'should set up a participants resources object' do