em-twitter 0.3.4 → 0.3.5
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.
- checksums.yaml +4 -4
- data/lib/em-twitter/request.rb +1 -4
- data/lib/em-twitter/version.rb +1 -1
- data/spec/em-twitter/client_spec.rb +1 -1
- data/spec/em-twitter/connection_reconnect_spec.rb +2 -2
- data/spec/em-twitter/connection_spec.rb +8 -8
- data/spec/em-twitter/proxy_spec.rb +1 -1
- data/spec/em-twitter/request_spec.rb +2 -2
- data/spec/em-twitter/response_spec.rb +4 -4
- data/spec/spec_helper.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f72b2475176af50d7783862abe0d6c16abdc281
|
4
|
+
data.tar.gz: 0ef0ab7682d0999e5dcf2e38194b79c8e5c18592
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cefd4b25f766aea1cd27091e0265cc4ddefac4d20b63093e0a1802fbb6b4ad98d5f69755191a8ed16bbde312fc95c17a84f5ad07b38a1ffe606318d8edd82c1
|
7
|
+
data.tar.gz: 2290cd0e16b1b7d91cebbb3b4cbbf3fc54b5d9499aed2f9e1672637c1df7b751e4a1b91952025f3e09d956ce982ffe55689994a67dea1e084aea0dea5d5a9d4b
|
data/lib/em-twitter/request.rb
CHANGED
@@ -104,10 +104,7 @@ module EventMachine
|
|
104
104
|
end
|
105
105
|
|
106
106
|
def oauth_params
|
107
|
-
|
108
|
-
hash[key] = @options[:oauth][key] if @options[:oauth].key?(key)
|
109
|
-
hash
|
110
|
-
end
|
107
|
+
@options[:oauth].merge(:ignore_extra_keys => true)
|
111
108
|
end
|
112
109
|
|
113
110
|
def basic_auth?
|
data/lib/em-twitter/version.rb
CHANGED
@@ -54,7 +54,7 @@ describe EM::Twitter::Client do
|
|
54
54
|
it "delegate to the connection" do
|
55
55
|
EM.run_block do
|
56
56
|
client = EM::Twitter::Client.connect(default_options)
|
57
|
-
expect(client.respond_to?(:immediate_reconnect)).to
|
57
|
+
expect(client.respond_to?(:immediate_reconnect)).to be_truthy
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -114,7 +114,7 @@ describe "EM::Twitter::Connection reconnections" do
|
|
114
114
|
client.on_reconnect { called = true; EM.stop }
|
115
115
|
end
|
116
116
|
|
117
|
-
expect(called).to
|
117
|
+
expect(called).to be true
|
118
118
|
end
|
119
119
|
|
120
120
|
it "does not reconnect when auto_reconnect is false" do
|
@@ -146,7 +146,7 @@ describe "EM::Twitter::Connection reconnections" do
|
|
146
146
|
client.immediate_reconnect
|
147
147
|
end
|
148
148
|
|
149
|
-
expect(called).to
|
149
|
+
expect(called).to be true
|
150
150
|
end
|
151
151
|
|
152
152
|
it "reconnects the current connection" do
|
@@ -10,7 +10,7 @@ describe EM::Twitter::Connection do
|
|
10
10
|
client = EM::Twitter::Client.connect(default_options.merge(:on_inited => lambda { called = true}))
|
11
11
|
end
|
12
12
|
|
13
|
-
expect(called).to
|
13
|
+
expect(called).to be true
|
14
14
|
end
|
15
15
|
|
16
16
|
it "sets the inactivity timeout" do
|
@@ -150,7 +150,7 @@ describe EM::Twitter::Connection do
|
|
150
150
|
end
|
151
151
|
end
|
152
152
|
|
153
|
-
expect(called).to
|
153
|
+
expect(called).to be true
|
154
154
|
end
|
155
155
|
|
156
156
|
it "closes the connection when stalled to prompt a reconnect" do
|
@@ -165,7 +165,7 @@ describe EM::Twitter::Connection do
|
|
165
165
|
end
|
166
166
|
end
|
167
167
|
|
168
|
-
expect(called).to
|
168
|
+
expect(called).to be true
|
169
169
|
end
|
170
170
|
|
171
171
|
it "invokes a no-data callback when stalled without a response" do
|
@@ -186,7 +186,7 @@ describe EM::Twitter::Connection do
|
|
186
186
|
end
|
187
187
|
end
|
188
188
|
|
189
|
-
expect(stalled).to
|
189
|
+
expect(stalled).to be true
|
190
190
|
end
|
191
191
|
end
|
192
192
|
end
|
@@ -200,7 +200,7 @@ describe EM::Twitter::Connection do
|
|
200
200
|
client.on_close { called = true }
|
201
201
|
end
|
202
202
|
|
203
|
-
expect(called).to
|
203
|
+
expect(called).to be true
|
204
204
|
end
|
205
205
|
end
|
206
206
|
|
@@ -225,7 +225,7 @@ describe EM::Twitter::Connection do
|
|
225
225
|
EM.run_block do
|
226
226
|
client = EM::Twitter::Client.connect(default_options)
|
227
227
|
client.stop
|
228
|
-
expect(client.connection.auto_reconnect?).to
|
228
|
+
expect(client.connection.auto_reconnect?).to be_falsey
|
229
229
|
end
|
230
230
|
end
|
231
231
|
end
|
@@ -283,7 +283,7 @@ describe EM::Twitter::Connection do
|
|
283
283
|
EM.run do
|
284
284
|
client = EM::Twitter::Client.connect(default_options)
|
285
285
|
EM::Timer.new(1) do
|
286
|
-
expect(client.auto_reconnect?).to
|
286
|
+
expect(client.auto_reconnect?).to be true
|
287
287
|
EM.stop
|
288
288
|
end
|
289
289
|
end
|
@@ -293,7 +293,7 @@ describe EM::Twitter::Connection do
|
|
293
293
|
EM.run do
|
294
294
|
client = EM::Twitter::Client.connect(default_options.merge(:auto_reconnect => false))
|
295
295
|
EM::Timer.new(1) do
|
296
|
-
expect(client.auto_reconnect?).to
|
296
|
+
expect(client.auto_reconnect?).to be_falsey
|
297
297
|
EM.stop
|
298
298
|
end
|
299
299
|
end
|
@@ -12,7 +12,7 @@ describe EM::Twitter::Proxy do
|
|
12
12
|
|
13
13
|
describe "#header" do
|
14
14
|
it "returns false when no proxy credentials are passed" do
|
15
|
-
expect(EM::Twitter::Proxy.new.header).to
|
15
|
+
expect(EM::Twitter::Proxy.new.header).to be_falsey
|
16
16
|
end
|
17
17
|
|
18
18
|
it "generates a header when passed credentials" do
|
@@ -36,12 +36,12 @@ describe EM::Twitter::Request do
|
|
36
36
|
describe "#proxy?" do
|
37
37
|
it "defaults to false" do
|
38
38
|
req = EM::Twitter::Request.new
|
39
|
-
expect(req.proxy?).to
|
39
|
+
expect(req.proxy?).to be_falsey
|
40
40
|
end
|
41
41
|
|
42
42
|
it "returns true when a proxy is set" do
|
43
43
|
req = EM::Twitter::Request.new(proxy_options)
|
44
|
-
expect(req.proxy?).to
|
44
|
+
expect(req.proxy?).to be_truthy
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
@@ -66,25 +66,25 @@ describe EM::Twitter::Response do
|
|
66
66
|
|
67
67
|
describe "#complete?" do
|
68
68
|
it "returns false when an incomplete body" do
|
69
|
-
expect(EM::Twitter::Response.new('{ "status" : true').complete?).to
|
69
|
+
expect(EM::Twitter::Response.new('{ "status" : true').complete?).to be_falsey
|
70
70
|
end
|
71
71
|
|
72
72
|
it "returns false when an complete body" do
|
73
|
-
expect(EM::Twitter::Response.new('{ "status" : true }').complete?).to
|
73
|
+
expect(EM::Twitter::Response.new('{ "status" : true }').complete?).to be true
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
77
|
describe "#older_than?" do
|
78
78
|
it "returns false when the last response is younger than the number of seconds" do
|
79
79
|
response = EM::Twitter::Response.new
|
80
|
-
expect(response.older_than?(100)).to
|
80
|
+
expect(response.older_than?(100)).to be_falsey
|
81
81
|
end
|
82
82
|
|
83
83
|
it "returns true when the last response is older than the number of seconds" do
|
84
84
|
response = EM::Twitter::Response.new
|
85
85
|
response.concat('fakebody')
|
86
86
|
sleep(2)
|
87
|
-
expect(response.older_than?(1)).to
|
87
|
+
expect(response.older_than?(1)).to be true
|
88
88
|
end
|
89
89
|
|
90
90
|
it "generates a timestamp when no initial timestamp exists" do
|
data/spec/spec_helper.rb
CHANGED