pubnub 3.5.8 → 3.5.12

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pubnub might be problematic. Click here for more details.

@@ -31,6 +31,31 @@ describe "#grant" do
31
31
  Pubnub::Grant.any_instance.stub(:signature).and_return 'kdDh/sFC3rSR%2Bt5AEymIc57d1velIr562V7usa5M4k0='
32
32
 
33
33
  end
34
+
35
+ it 'Works with given multiple channels as string' do
36
+ VCR.use_cassette("grant-multiple-channels", :record => :none) do
37
+ @pn.grant(:ssl => true, :http_sync => true, :channel => "demo,demo1,demo2", :auth_key => "authkey", :write => true, :read => true, &@callback)
38
+
39
+ @after_callback.should eq true
40
+ @response_output.seek 0
41
+ @response_output.read.should eq '{"status":200,"message":"Success","payload":{"auths":{"authkey":{"r":1,"w":1}},"subscribe_key":"sub-c-53c3d30a-4135-11e3-9970-02ee2ddab7fe","ttl":3600,"channel":"demo,demo1,demo2","level":"user"},"service":"Access Manager"}'
42
+ @message_output.seek 0
43
+ @message_output.read.should eq 'Success'
44
+ end
45
+ end
46
+
47
+ it 'Works with given multiple channels as array' do
48
+ VCR.use_cassette("grant-multiple-channels", :record => :none) do
49
+ @pn.grant(:ssl => true, :http_sync => true, :channel => ['demo', 'demo1', 'demo2'], :auth_key => "authkey", :write => true, :read => true, &@callback)
50
+
51
+ @after_callback.should eq true
52
+ @response_output.seek 0
53
+ @response_output.read.should eq '{"status":200,"message":"Success","payload":{"auths":{"authkey":{"r":1,"w":1}},"subscribe_key":"sub-c-53c3d30a-4135-11e3-9970-02ee2ddab7fe","ttl":3600,"channel":"demo,demo1,demo2","level":"user"},"service":"Access Manager"}'
54
+ @message_output.seek 0
55
+ @message_output.read.should eq 'Success'
56
+ end
57
+ end
58
+
34
59
  context "uses ssl" do
35
60
  before(:each) { @ssl = true }
36
61
  it "Generates valid url for application level" do
@@ -0,0 +1,543 @@
1
+ require 'spec_helper'
2
+
3
+ describe "#here_now" do
4
+ before(:each) do
5
+
6
+ EM.stop if EM.reactor_running?
7
+ while EM.reactor_running? do end
8
+ sleep(0.1)
9
+
10
+ @response_output = StringIO.new
11
+ @message_output = StringIO.new
12
+
13
+ @callback = lambda { |envelope|
14
+ $logger.debug 'FIRING CALLBACK FROM TEST'
15
+ @response_output.write envelope.response
16
+ @message_output.write envelope.msg
17
+ @after_callback = true
18
+ }
19
+
20
+ @error_callback = lambda { |envelope|
21
+ $logger.debug 'FIRING ERROR CALLBACK FROM TEST'
22
+ @response_output.write envelope.response
23
+ @message_output.write envelope.msg
24
+ @after_error_callback = true
25
+ }
26
+
27
+ @pn = Pubnub.new(:disable_persistent_connection => true, :max_retries => 0, :subscribe_key => :demo, :publish_key => :demo, :auth_key => :demoish_authkey, :secret_key => 'some_secret_key', :error_callback => @error_callback)
28
+ @pn.uuid = 'rubytests'
29
+
30
+ end
31
+ context "uses ssl" do
32
+ before(:each) { @ssl = true }
33
+ context "passess callback as block" do
34
+ context "gets valid json in response" do
35
+ context "gets status 200 in response" do
36
+ context "uses sync connection" do
37
+ it 'works fine' do
38
+ VCR.use_cassette("here_now-ssl-block-valid-200-sync", :record => :none) do
39
+ @pn.here_now(:ssl => true, :http_sync => true, :channel => "demo", &@callback)
40
+
41
+ @after_callback.should eq true
42
+ @response_output.seek 0
43
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
44
+ @message_output.seek 0
45
+ @message_output.read.should eq '{"uuids"=>["rubytests"], "occupancy"=>1}'
46
+ end
47
+ end
48
+ end
49
+ context "uses async connection" do
50
+ it 'works fine' do
51
+ VCR.use_cassette("here_now-ssl-block-valid-200-async", :record => :none) do
52
+ @pn.here_now(:ssl => true, :http_sync => false, :channel => "demo", &@callback)
53
+
54
+ eventually do
55
+ @after_callback.should eq true
56
+ @response_output.seek 0
57
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
58
+ @message_output.seek 0
59
+ @message_output.read.should eq '{"uuids"=>["rubytests"], "occupancy"=>1}'
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ context "gets status non-200 in response" do
66
+ context "uses sync connection" do
67
+ it 'works fine' do
68
+ VCR.use_cassette("here_now-ssl-block-valid-non-200-sync", :record => :none) do
69
+ @pn.here_now(:ssl => true, :http_sync => true, :channel => "demo", &@callback)
70
+
71
+ @after_error_callback.should eq true
72
+ @response_output.seek 0
73
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
74
+ @message_output.seek 0
75
+ @message_output.read.should eq '[0,"Non 2xx server response."]'
76
+ end
77
+ end
78
+ end
79
+ context "uses async connection" do
80
+ it 'works fine' do
81
+ VCR.use_cassette("here_now-ssl-block-valid-non-200-async", :record => :none) do
82
+ @pn.here_now(:ssl => true, :http_sync => false, :channel => "demo", &@callback)
83
+
84
+ eventually do
85
+ @after_error_callback.should eq true
86
+ @response_output.seek 0
87
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
88
+ @message_output.seek 0
89
+ @message_output.read.should eq '[0,"Non 2xx server response."]'
90
+ end
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
96
+ context "gets invalid json in response" do
97
+ context "gets status 200 in response" do
98
+ context "uses sync connection" do
99
+ it 'works fine' do
100
+ VCR.use_cassette("here_now-ssl-block-invalid-200-sync", :record => :none) do
101
+ @pn.here_now(:ssl => true, :http_sync => true, :channel => "demo", &@callback)
102
+
103
+ @after_error_callback.should eq true
104
+ @response_output.seek 0
105
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1'
106
+ @message_output.seek 0
107
+ @message_output.read.should eq '[0,"Invalid JSON in response."]'
108
+ end
109
+ end
110
+ end
111
+ context "uses async connection" do
112
+ it 'works fine' do
113
+ VCR.use_cassette("here_now-ssl-block-invalid-200-async", :record => :none) do
114
+ @pn.here_now(:ssl => true, :http_sync => false, :channel => "demo", &@callback)
115
+
116
+ eventually do
117
+ @after_error_callback.should eq true
118
+ @response_output.seek 0
119
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1'
120
+ @message_output.seek 0
121
+ @message_output.read.should eq '[0,"Invalid JSON in response."]'
122
+ end
123
+ end
124
+ end
125
+ end
126
+ end
127
+ context "gets status non-200 in response" do
128
+ context "uses sync connection" do
129
+ it 'works fine' do
130
+ VCR.use_cassette("here_now-ssl-block-invalid-non-200-sync", :record => :none) do
131
+ @pn.here_now(:ssl => true, :http_sync => true, :channel => "demo", &@callback)
132
+
133
+ @after_error_callback.should eq true
134
+ @response_output.seek 0
135
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1'
136
+ @message_output.seek 0
137
+ @message_output.read.should eq '[0,"Invalid JSON in response."]'
138
+ end
139
+ end
140
+ end
141
+ context "uses async connection" do
142
+ it 'works fine' do
143
+ VCR.use_cassette("here_now-ssl-block-invalid-non-200-async", :record => :none) do
144
+ @pn.here_now(:ssl => true, :http_sync => false, :channel => "demo", &@callback)
145
+
146
+ eventually do
147
+ @after_error_callback.should eq true
148
+ @response_output.seek 0
149
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1'
150
+ @message_output.seek 0
151
+ @message_output.read.should eq '[0,"Invalid JSON in response."]'
152
+ end
153
+ end
154
+ end
155
+ end
156
+ end
157
+ end
158
+ end
159
+ context "passess callback as parameter" do
160
+ context "gets valid json in response" do
161
+ context "gets status 200 in response" do
162
+ context "uses sync connection" do
163
+ it 'works fine' do
164
+ VCR.use_cassette("here_now-ssl-parameter-valid-200-sync", :record => :none) do
165
+ @pn.here_now(:ssl => true, :http_sync => true, :channel => "demo", :callback => @callback)
166
+
167
+ @after_callback.should eq true
168
+ @response_output.seek 0
169
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
170
+ @message_output.seek 0
171
+ @message_output.read.should eq '{"uuids"=>["rubytests"], "occupancy"=>1}'
172
+ end
173
+ end
174
+ end
175
+ context "uses async connection" do
176
+ it 'works fine' do
177
+ VCR.use_cassette("here_now-ssl-parameter-valid-200-async", :record => :none) do
178
+ @pn.here_now(:ssl => true, :http_sync => false, :channel => "demo", :callback => @callback)
179
+
180
+ eventually do
181
+ @after_callback.should eq true
182
+ @response_output.seek 0
183
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
184
+ @message_output.seek 0
185
+ @message_output.read.should eq '{"uuids"=>["rubytests"], "occupancy"=>1}'
186
+ end
187
+ end
188
+ end
189
+ end
190
+ end
191
+ context "gets status non-200 in response" do
192
+ context "uses sync connection" do
193
+ it 'works fine' do
194
+ VCR.use_cassette("here_now-ssl-parameter-valid-non-200-sync", :record => :none) do
195
+ @pn.here_now(:ssl => true, :http_sync => true, :channel => "demo", :callback => @callback)
196
+
197
+ @after_error_callback.should eq true
198
+ @response_output.seek 0
199
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
200
+ @message_output.seek 0
201
+ @message_output.read.should eq '[0,"Non 2xx server response."]'
202
+ end
203
+ end
204
+ end
205
+ context "uses async connection" do
206
+ it 'works fine' do
207
+ VCR.use_cassette("here_now-ssl-parameter-valid-non-200-async", :record => :none) do
208
+ @pn.here_now(:ssl => true, :http_sync => false, :channel => "demo", :callback => @callback)
209
+
210
+ eventually do
211
+ @after_error_callback.should eq true
212
+ @response_output.seek 0
213
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
214
+ @message_output.seek 0
215
+ @message_output.read.should eq '[0,"Non 2xx server response."]'
216
+ end
217
+ end
218
+ end
219
+ end
220
+ end
221
+ end
222
+ context "gets invalid json in response" do
223
+ context "gets status 200 in response" do
224
+ context "uses sync connection" do
225
+ it 'works fine' do
226
+ VCR.use_cassette("here_now-ssl-parameter-invalid-200-sync", :record => :none) do
227
+ @pn.here_now(:ssl => true, :http_sync => true, :channel => "demo", :callback => @callback)
228
+
229
+ @after_error_callback.should eq true
230
+ @response_output.seek 0
231
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1'
232
+ @message_output.seek 0
233
+ @message_output.read.should eq '[0,"Invalid JSON in response."]'
234
+ end
235
+ end
236
+ end
237
+ context "uses async connection" do
238
+ it 'works fine' do
239
+ VCR.use_cassette("here_now-ssl-parameter-invalid-200-async", :record => :none) do
240
+ @pn.here_now(:ssl => true, :http_sync => false, :channel => "demo", :callback => @callback)
241
+
242
+ eventually do
243
+ @after_error_callback.should eq true
244
+ @response_output.seek 0
245
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1'
246
+ @message_output.seek 0
247
+ @message_output.read.should eq '[0,"Invalid JSON in response."]'
248
+ end
249
+ end
250
+ end
251
+ end
252
+ end
253
+ context "gets status non-200 in response" do
254
+ context "uses sync connection" do
255
+ it 'works fine' do
256
+ VCR.use_cassette("here_now-ssl-parameter-invalid-non-200-sync", :record => :none) do
257
+ @pn.here_now(:ssl => true, :http_sync => true, :channel => "demo", :callback => @callback)
258
+
259
+ @after_error_callback.should eq true
260
+ @response_output.seek 0
261
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1'
262
+ @message_output.seek 0
263
+ @message_output.read.should eq '[0,"Invalid JSON in response."]'
264
+ end
265
+ end
266
+ end
267
+ context "uses async connection" do
268
+ it 'works fine' do
269
+ VCR.use_cassette("here_now-ssl-parameter-invalid-non-200-async", :record => :none) do
270
+ @pn.here_now(:ssl => true, :http_sync => false, :channel => "demo", :callback => @callback)
271
+
272
+ eventually do
273
+ @after_error_callback.should eq true
274
+ @response_output.seek 0
275
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1'
276
+ @message_output.seek 0
277
+ @message_output.read.should eq '[0,"Invalid JSON in response."]'
278
+ end
279
+ end
280
+ end
281
+ end
282
+ end
283
+ end
284
+ end
285
+ end
286
+ context "uses non-ssl" do
287
+ before(:each) { @ssl = false }
288
+ context "passess callback as block" do
289
+ context "gets valid json in response" do
290
+ context "gets status 200 in response" do
291
+ context "uses sync connection" do
292
+ it 'works fine' do
293
+ VCR.use_cassette("here_now-nonssl-block-valid-200-sync", :record => :none) do
294
+ @pn.here_now(:ssl => false, :http_sync => true, :channel => "demo", &@callback)
295
+
296
+ @after_callback.should eq true
297
+ @response_output.seek 0
298
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
299
+ @message_output.seek 0
300
+ @message_output.read.should eq '{"uuids"=>["rubytests"], "occupancy"=>1}'
301
+ end
302
+ end
303
+ end
304
+ context "uses async connection" do
305
+ it 'works fine' do
306
+ VCR.use_cassette("here_now-nonssl-block-valid-200-async", :record => :none) do
307
+ @pn.here_now(:ssl => false, :http_sync => false, :channel => "demo", &@callback)
308
+
309
+ eventually do
310
+ @after_callback.should eq true
311
+ @response_output.seek 0
312
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
313
+ @message_output.seek 0
314
+ @message_output.read.should eq '{"uuids"=>["rubytests"], "occupancy"=>1}'
315
+ end
316
+ end
317
+ end
318
+ end
319
+ end
320
+ context "gets status non-200 in response" do
321
+ context "uses sync connection" do
322
+ it 'works fine' do
323
+ VCR.use_cassette("here_now-nonssl-block-valid-non-200-sync", :record => :none) do
324
+ @pn.here_now(:ssl => false, :http_sync => true, :channel => "demo", &@callback)
325
+
326
+ @after_error_callback.should eq true
327
+ @response_output.seek 0
328
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
329
+ @message_output.seek 0
330
+ @message_output.read.should eq '[0,"Non 2xx server response."]'
331
+ end
332
+ end
333
+ end
334
+ context "uses async connection" do
335
+ it 'works fine' do
336
+ VCR.use_cassette("here_now-nonssl-block-valid-non-200-async", :record => :none) do
337
+ @pn.here_now(:ssl => false, :http_sync => false, :channel => "demo", &@callback)
338
+
339
+ eventually do
340
+ @after_error_callback.should eq true
341
+ @response_output.seek 0
342
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
343
+ @message_output.seek 0
344
+ @message_output.read.should eq '[0,"Non 2xx server response."]'
345
+ end
346
+ end
347
+ end
348
+ end
349
+ end
350
+ end
351
+ context "gets invalid json in response" do
352
+ context "gets status 200 in response" do
353
+ context "uses sync connection" do
354
+ it 'works fine' do
355
+ VCR.use_cassette("here_now-nonssl-block-invalid-200-sync", :record => :none) do
356
+ @pn.here_now(:ssl => false, :http_sync => true, :channel => "demo", &@callback)
357
+
358
+ eventually do
359
+ @after_error_callback.should eq true
360
+ @response_output.seek 0
361
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1'
362
+ @message_output.seek 0
363
+ @message_output.read.should eq '[0,"Invalid JSON in response."]'
364
+ end
365
+ end
366
+ end
367
+ end
368
+ context "uses async connection" do
369
+ it 'works fine' do
370
+ VCR.use_cassette("here_now-nonssl-block-invalid-200-async", :record => :none) do
371
+ @pn.here_now(:ssl => false, :http_sync => false, :channel => "demo", &@callback)
372
+
373
+ eventually do
374
+ @after_error_callback.should eq true
375
+ @response_output.seek 0
376
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1'
377
+ @message_output.seek 0
378
+ @message_output.read.should eq '[0,"Invalid JSON in response."]'
379
+ end
380
+ end
381
+ end
382
+ end
383
+ end
384
+ context "gets status non-200 in response" do
385
+ context "uses sync connection" do
386
+ it 'works fine' do
387
+ VCR.use_cassette("here_now-nonssl-block-invalid-non-200-sync", :record => :none) do
388
+ @pn.here_now(:ssl => false, :http_sync => true, :channel => "demo", &@callback)
389
+
390
+ @after_error_callback.should eq true
391
+ @response_output.seek 0
392
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1'
393
+ @message_output.seek 0
394
+ @message_output.read.should eq '[0,"Invalid JSON in response."]'
395
+ end
396
+ end
397
+ end
398
+ context "uses async connection" do
399
+ it 'works fine' do
400
+ VCR.use_cassette("here_now-nonssl-block-invalid-non-200-async", :record => :none) do
401
+ @pn.here_now(:ssl => false, :http_sync => false, :channel => "demo", &@callback)
402
+
403
+ eventually do
404
+ @after_error_callback.should eq true
405
+ @response_output.seek 0
406
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1'
407
+ @message_output.seek 0
408
+ @message_output.read.should eq '[0,"Invalid JSON in response."]'
409
+ end
410
+ end
411
+ end
412
+ end
413
+ end
414
+ end
415
+ end
416
+ context "passess callback as parameter" do
417
+ context "gets valid json in response" do
418
+ context "gets status 200 in response" do
419
+ context "uses sync connection" do
420
+ it 'works fine' do
421
+ VCR.use_cassette("here_now-nonssl-parameter-valid-200-sync", :record => :none) do
422
+ @pn.here_now(:ssl => false, :http_sync => true, :channel => "demo", :callback => @callback)
423
+
424
+ @after_callback.should eq true
425
+ @response_output.seek 0
426
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
427
+ @message_output.seek 0
428
+ @message_output.read.should eq '{"uuids"=>["rubytests"], "occupancy"=>1}'
429
+ end
430
+ end
431
+ end
432
+ context "uses async connection" do
433
+ it 'works fine' do
434
+ VCR.use_cassette("here_now-nonssl-parameter-valid-200-async", :record => :none) do
435
+ @pn.here_now(:ssl => false, :http_sync => false, :channel => "demo", :callback => @callback)
436
+
437
+ eventually do
438
+ @after_callback.should eq true
439
+ @response_output.seek 0
440
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
441
+ @message_output.seek 0
442
+ @message_output.read.should eq '{"uuids"=>["rubytests"], "occupancy"=>1}'
443
+ end
444
+ end
445
+ end
446
+ end
447
+ end
448
+ context "gets status non-200 in response" do
449
+ context "uses sync connection" do
450
+ it 'works fine' do
451
+ VCR.use_cassette("here_now-nonssl-parameter-valid-non-200-sync", :record => :none) do
452
+ @pn.here_now(:ssl => false, :http_sync => true, :channel => "demo", :callback => @callback)
453
+
454
+ @after_error_callback.should eq true
455
+ @response_output.seek 0
456
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
457
+ @message_output.seek 0
458
+ @message_output.read.should eq '[0,"Non 2xx server response."]'
459
+ end
460
+ end
461
+ end
462
+ context "uses async connection" do
463
+ it 'works fine' do
464
+ VCR.use_cassette("here_now-nonssl-parameter-valid-non-200-async", :record => :none) do
465
+ @pn.here_now(:ssl => false, :http_sync => false, :channel => "demo", :callback => @callback)
466
+
467
+ eventually do
468
+ @after_error_callback.should eq true
469
+ @response_output.seek 0
470
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
471
+ @message_output.seek 0
472
+ @message_output.read.should eq '[0,"Non 2xx server response."]'
473
+ end
474
+ end
475
+ end
476
+ end
477
+ end
478
+ end
479
+ context "gets invalid json in response" do
480
+ context "gets status 200 in response" do
481
+ context "uses sync connection" do
482
+ it 'works fine' do
483
+ VCR.use_cassette("here_now-nonssl-parameter-invalid-200-sync", :record => :none) do
484
+ @pn.here_now(:ssl => false, :http_sync => true, :channel => "demo", :callback => @callback)
485
+
486
+ @after_error_callback.should eq true
487
+ @response_output.seek 0
488
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1'
489
+ @message_output.seek 0
490
+ @message_output.read.should eq '[0,"Invalid JSON in response."]'
491
+ end
492
+ end
493
+ end
494
+ context "uses async connection" do
495
+ it 'works fine' do
496
+ VCR.use_cassette("here_now-nonssl-parameter-invalid-200-async", :record => :none) do
497
+ @pn.here_now(:ssl => false, :http_sync => false, :channel => "demo", :callback => @callback)
498
+
499
+ eventually do
500
+ @after_error_callback.should eq true
501
+ @response_output.seek 0
502
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1'
503
+ @message_output.seek 0
504
+ @message_output.read.should eq '[0,"Invalid JSON in response."]'
505
+ end
506
+ end
507
+ end
508
+ end
509
+ end
510
+ context "gets status non-200 in response" do
511
+ context "uses sync connection" do
512
+ it 'works fine' do
513
+ VCR.use_cassette("here_now-nonssl-parameter-invalid-non-200-sync", :record => :none) do
514
+ @pn.here_now(:ssl => false, :http_sync => true, :channel => "demo", :callback => @callback)
515
+
516
+ @after_error_callback.should eq true
517
+ @response_output.seek 0
518
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1'
519
+ @message_output.seek 0
520
+ @message_output.read.should eq '[0,"Invalid JSON in response."]'
521
+ end
522
+ end
523
+ end
524
+ context "uses async connection" do
525
+ it 'works fine' do
526
+ VCR.use_cassette("here_now-nonssl-parameter-invalid-non-200-async", :record => :none) do
527
+ @pn.here_now(:ssl => false, :http_sync => false, :channel => "demo", :callback => @callback)
528
+
529
+ eventually do
530
+ @after_error_callback.should eq true
531
+ @response_output.seek 0
532
+ @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1'
533
+ @message_output.seek 0
534
+ @message_output.read.should eq '[0,"Invalid JSON in response."]'
535
+ end
536
+ end
537
+ end
538
+ end
539
+ end
540
+ end
541
+ end
542
+ end
543
+ end