twilio-ruby 3.4.1 → 3.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/twilio-ruby.rb +1 -1
- data/lib/twilio-ruby/rest/calls.rb +1 -1
- data/lib/twilio-ruby/rest/recordings.rb +1 -0
- data/lib/twilio-ruby/version.rb +1 -1
- data/test/twilio_spec.rb +30 -25
- metadata +4 -4
data/lib/twilio-ruby.rb
CHANGED
@@ -7,7 +7,7 @@ require 'openssl'
|
|
7
7
|
require 'base64'
|
8
8
|
require 'jwt'
|
9
9
|
|
10
|
-
require 'twilio-ruby/version'
|
10
|
+
require 'twilio-ruby/version' unless defined?(Twilio::VERSION)
|
11
11
|
require 'twilio-ruby/util'
|
12
12
|
require 'twilio-ruby/util/request_validator'
|
13
13
|
require 'twilio-ruby/util/capability'
|
data/lib/twilio-ruby/version.rb
CHANGED
data/test/twilio_spec.rb
CHANGED
@@ -16,9 +16,10 @@ describe Twilio::REST::Client do
|
|
16
16
|
|
17
17
|
it 'should set up the proper default http ssl connection' do
|
18
18
|
twilio = Twilio::REST::Client.new('someSid', 'someToken')
|
19
|
-
twilio.instance_variable_get('@connection')
|
20
|
-
|
21
|
-
|
19
|
+
connection = twilio.instance_variable_get('@connection')
|
20
|
+
connection.address.should == 'api.twilio.com'
|
21
|
+
connection.port.should == 443
|
22
|
+
connection.use_ssl?.should == true
|
22
23
|
end
|
23
24
|
|
24
25
|
it 'should set up the requested ssl verification ca_file if provided' do
|
@@ -29,38 +30,42 @@ describe Twilio::REST::Client do
|
|
29
30
|
|
30
31
|
it 'should set up the proper http ssl connection when a different domain is given' do
|
31
32
|
twilio = Twilio::REST::Client.new('someSid', 'someToken', :host => 'api.faketwilio.com')
|
32
|
-
twilio.instance_variable_get('@connection')
|
33
|
-
|
34
|
-
|
33
|
+
connection = twilio.instance_variable_get('@connection')
|
34
|
+
connection.address.should == 'api.faketwilio.com'
|
35
|
+
connection.port.should == 443
|
36
|
+
connection.use_ssl?.should == true
|
35
37
|
end
|
36
38
|
|
37
39
|
it 'should adjust the open and read timeouts on the underlying Net::HTTP object when asked' do
|
38
40
|
timeout = rand(30)
|
39
41
|
twilio = Twilio::REST::Client.new('someSid', 'someToken', :timeout => timeout)
|
40
|
-
twilio.instance_variable_get('@connection')
|
41
|
-
|
42
|
-
|
43
|
-
|
42
|
+
connection = twilio.instance_variable_get('@connection')
|
43
|
+
connection.port.should == 443
|
44
|
+
connection.use_ssl?.should == true
|
45
|
+
connection.open_timeout.should == timeout
|
46
|
+
connection.read_timeout.should == timeout
|
44
47
|
end
|
45
48
|
|
46
49
|
it 'should set up the proper http ssl connection when a proxy_host is given' do
|
47
50
|
twilio = Twilio::REST::Client.new('someSid', 'someToken', :host => 'api.faketwilio.com', :proxy_addr => 'localhost')
|
48
|
-
twilio.instance_variable_get('@connection')
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
connection = twilio.instance_variable_get('@connection')
|
52
|
+
connection.proxy?.should == true
|
53
|
+
connection.proxy_address.should == 'localhost'
|
54
|
+
connection.proxy_port.should == 80
|
55
|
+
connection.address.should == 'api.faketwilio.com'
|
56
|
+
connection.port.should == 443
|
57
|
+
connection.use_ssl?.should == true
|
54
58
|
end
|
55
59
|
|
56
60
|
it 'should set up the proper http ssl connection when a proxy_host and proxy_port are given' do
|
57
61
|
twilio = Twilio::REST::Client.new('someSid', 'someToken', :host => 'api.faketwilio.com', :proxy_addr => 'localhost', :proxy_port => 13128)
|
58
|
-
twilio.instance_variable_get('@connection')
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
62
|
+
connection = twilio.instance_variable_get('@connection')
|
63
|
+
connection.proxy?.should == true
|
64
|
+
connection.proxy_address.should == 'localhost'
|
65
|
+
connection.proxy_port.should == 13128
|
66
|
+
connection.address.should == 'api.faketwilio.com'
|
67
|
+
connection.port.should == 443
|
68
|
+
connection.use_ssl?.should == true
|
64
69
|
end
|
65
70
|
|
66
71
|
it 'should set up an accounts resources object' do
|
@@ -164,10 +169,10 @@ describe Twilio::REST::Call do
|
|
164
169
|
call.recordings.instance_variable_get('@uri').should == 'someUri/Recordings'
|
165
170
|
end
|
166
171
|
|
167
|
-
it 'should set up a
|
172
|
+
it 'should set up a notifications resources object' do
|
168
173
|
call = Twilio::REST::Call.new('someUri', 'someClient')
|
169
|
-
call.respond_to?(:
|
170
|
-
call.
|
174
|
+
call.respond_to?(:notifications).should == true
|
175
|
+
call.notifications.instance_variable_get('@uri').should == 'someUri/Notifications'
|
171
176
|
end
|
172
177
|
end
|
173
178
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twilio-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 3.4.
|
9
|
+
- 2
|
10
|
+
version: 3.4.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andrew Benton
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-10-
|
18
|
+
date: 2011-10-13 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|