pubnub 3.5.14 → 3.6.7

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.

Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/3.5_to_3.6_upgrade_notes.md +148 -0
  3. data/{CHANGELOG → CHANGELOG.txt} +15 -0
  4. data/Gemfile.lock +5 -4
  5. data/LICENSE.txt +28 -0
  6. data/README.md +164 -19
  7. data/Rakefile +1 -6
  8. data/examples/demo_console.rb +370 -329
  9. data/fixtures/vcr_cassettes/grant-multiple-channels-presence-multi-1.yml +44 -0
  10. data/fixtures/vcr_cassettes/grant-multiple-channels-presence-multi-2.yml +44 -0
  11. data/fixtures/vcr_cassettes/grant-multiple-channels-presence-multi-3.yml +44 -0
  12. data/fixtures/vcr_cassettes/grant-multiple-channels-presence-multi-4.yml +44 -0
  13. data/fixtures/vcr_cassettes/grant-multiple-channels-presence.yml +44 -0
  14. data/fixtures/vcr_cassettes/heartbeated-subscribe.yml +1 -1
  15. data/fixtures/vcr_cassettes/here_now-nonssl-block-valid-200-async.yml +1 -1
  16. data/fixtures/vcr_cassettes/here_now-nonssl-block-valid-200-sync.yml +1 -1
  17. data/fixtures/vcr_cassettes/here_now-nonssl-block-valid-non-200-async.yml +1 -1
  18. data/fixtures/vcr_cassettes/here_now-nonssl-block-valid-non-200-sync.yml +1 -1
  19. data/fixtures/vcr_cassettes/here_now-nonssl-parameter-valid-200-async.yml +1 -1
  20. data/fixtures/vcr_cassettes/here_now-nonssl-parameter-valid-200-sync.yml +1 -1
  21. data/fixtures/vcr_cassettes/here_now-nonssl-parameter-valid-non-200-async.yml +1 -1
  22. data/fixtures/vcr_cassettes/here_now-nonssl-parameter-valid-non-200-sync.yml +1 -1
  23. data/fixtures/vcr_cassettes/here_now-ssl-block-valid-200-async.yml +1 -1
  24. data/fixtures/vcr_cassettes/here_now-ssl-block-valid-200-sync.yml +1 -1
  25. data/fixtures/vcr_cassettes/here_now-ssl-block-valid-non-200-async.yml +1 -1
  26. data/fixtures/vcr_cassettes/here_now-ssl-block-valid-non-200-sync.yml +1 -1
  27. data/fixtures/vcr_cassettes/here_now-ssl-parameter-valid-200-async.yml +1 -1
  28. data/fixtures/vcr_cassettes/here_now-ssl-parameter-valid-200-sync.yml +1 -1
  29. data/fixtures/vcr_cassettes/here_now-ssl-parameter-valid-non-200-async.yml +1 -1
  30. data/fixtures/vcr_cassettes/here_now-ssl-parameter-valid-non-200-sync.yml +1 -1
  31. data/fixtures/vcr_cassettes/leave-nonssl-block-valid-200-async.yml +1 -1
  32. data/fixtures/vcr_cassettes/leave-nonssl-block-valid-200-sync.yml +1 -1
  33. data/fixtures/vcr_cassettes/leave-nonssl-block-valid-non-200-async.yml +1 -1
  34. data/fixtures/vcr_cassettes/leave-nonssl-block-valid-non-200-sync.yml +1 -1
  35. data/fixtures/vcr_cassettes/leave-nonssl-parameter-valid-200-async.yml +1 -1
  36. data/fixtures/vcr_cassettes/leave-nonssl-parameter-valid-200-sync.yml +1 -1
  37. data/fixtures/vcr_cassettes/leave-nonssl-parameter-valid-non-200-async.yml +1 -1
  38. data/fixtures/vcr_cassettes/leave-nonssl-parameter-valid-non-200-sync.yml +1 -1
  39. data/fixtures/vcr_cassettes/leave-ssl-block-valid-200-async.yml +1 -1
  40. data/fixtures/vcr_cassettes/leave-ssl-block-valid-200-sync.yml +1 -1
  41. data/fixtures/vcr_cassettes/leave-ssl-block-valid-non-200-async.yml +1 -1
  42. data/fixtures/vcr_cassettes/leave-ssl-block-valid-non-200-sync.yml +1 -1
  43. data/fixtures/vcr_cassettes/leave-ssl-parameter-valid-200-async.yml +1 -1
  44. data/fixtures/vcr_cassettes/leave-ssl-parameter-valid-200-sync.yml +1 -1
  45. data/fixtures/vcr_cassettes/leave-ssl-parameter-valid-non-200-async.yml +1 -1
  46. data/fixtures/vcr_cassettes/leave-ssl-parameter-valid-non-200-sync.yml +1 -1
  47. data/fixtures/vcr_cassettes/state-async-set-state-via-subbedclient-2.yml +140 -0
  48. data/fixtures/vcr_cassettes/state-async-set-state-via-subbedclient.yml +131 -0
  49. data/fixtures/vcr_cassettes/state-async-set-state-via-subscribe.yml +90 -0
  50. data/fixtures/vcr_cassettes/state-set-state-via-client-2.yml +140 -0
  51. data/fixtures/vcr_cassettes/state-set-state-via-client.yml +90 -0
  52. data/fixtures/vcr_cassettes/state-set-state-via-subscribe.yml +90 -0
  53. data/fixtures/vcr_cassettes/where_now-ssl-block-invalid-200-async.yml +49 -0
  54. data/fixtures/vcr_cassettes/where_now-ssl-block-invalid-200-sync.yml +49 -0
  55. data/fixtures/vcr_cassettes/where_now-ssl-block-invalid-non-200-async.yml +49 -0
  56. data/fixtures/vcr_cassettes/where_now-ssl-block-invalid-non-200-sync.yml +49 -0
  57. data/fixtures/vcr_cassettes/where_now-ssl-block-valid-200-async.yml +49 -0
  58. data/fixtures/vcr_cassettes/where_now-ssl-block-valid-200-sync.yml +49 -0
  59. data/fixtures/vcr_cassettes/where_now-ssl-block-valid-non-200-async.yml +49 -0
  60. data/fixtures/vcr_cassettes/where_now-ssl-block-valid-non-200-sync.yml +49 -0
  61. data/fixtures/vcr_cassettes/where_now-ssl-parameter-invalid-200-async.yml +49 -0
  62. data/fixtures/vcr_cassettes/where_now-ssl-parameter-invalid-200-sync.yml +49 -0
  63. data/fixtures/vcr_cassettes/where_now-ssl-parameter-invalid-non-200-async.yml +49 -0
  64. data/fixtures/vcr_cassettes/where_now-ssl-parameter-invalid-non-200-sync.yml +49 -0
  65. data/fixtures/vcr_cassettes/where_now-ssl-parameter-valid-200-async.yml +49 -0
  66. data/fixtures/vcr_cassettes/where_now-ssl-parameter-valid-200-sync.yml +49 -0
  67. data/fixtures/vcr_cassettes/where_now-ssl-parameter-valid-non-200-async.yml +49 -0
  68. data/fixtures/vcr_cassettes/where_now-ssl-parameter-valid-non-200-sync.yml +49 -0
  69. data/lib/pubnub.rb +1 -2
  70. data/lib/pubnub/client.rb +97 -21
  71. data/lib/pubnub/configuration.rb +1 -1
  72. data/lib/pubnub/envelope.rb +3 -2
  73. data/lib/pubnub/event.rb +9 -5
  74. data/lib/pubnub/events/audit.rb +1 -1
  75. data/lib/pubnub/events/grant.rb +1 -1
  76. data/lib/pubnub/events/heartbeat.rb +7 -3
  77. data/lib/pubnub/events/here_now.rb +7 -4
  78. data/lib/pubnub/events/history.rb +1 -1
  79. data/lib/pubnub/events/leave.rb +10 -4
  80. data/lib/pubnub/events/presence.rb +1 -1
  81. data/lib/pubnub/events/publish.rb +6 -2
  82. data/lib/pubnub/events/revoke.rb +1 -1
  83. data/lib/pubnub/events/set_state.rb +77 -0
  84. data/lib/pubnub/events/state.rb +63 -0
  85. data/lib/pubnub/events/subscribe.rb +7 -0
  86. data/lib/pubnub/events/where_now.rb +55 -0
  87. data/lib/pubnub/pam.rb +10 -16
  88. data/lib/pubnub/version.rb +2 -2
  89. data/pubnub.gemspec +21 -19
  90. data/spec/lib/channel_presence_concat_pam_spec.rb +94 -0
  91. data/spec/lib/client_spec.rb +3 -4
  92. data/spec/lib/heartbeat_spec.rb +16 -16
  93. data/spec/lib/integration/global_here_now_dpc_spec.rb +10 -10
  94. data/spec/lib/integration/global_here_now_spec.rb +8 -8
  95. data/spec/lib/integration/here_now_dpc_spec.rb +24 -24
  96. data/spec/lib/integration/here_now_spec.rb +24 -24
  97. data/spec/lib/integration/leave_dpc_spec.rb +24 -25
  98. data/spec/lib/integration/leave_spec.rb +24 -24
  99. data/spec/lib/integration/publish_spec.rb +5 -0
  100. data/spec/lib/integration/state_spec.rb +84 -0
  101. data/spec/lib/integration/where_now_spec.rb +312 -0
  102. metadata +108 -26
  103. data/LICENSE +0 -27
  104. data/VERSION +0 -1
  105. data/examples/demo_console_new.rb +0 -286
  106. data/fixtures/vcr_cassettes/heartbeat-non200.yml +0 -667
  107. data/spec/tools/pam-test-generator.rb +0 -367
  108. data/spec/tools/test-generator.rb +0 -310
@@ -0,0 +1,94 @@
1
+ require 'spec_helper'
2
+
3
+ describe "#grant" 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(:max_retries => 0, :subscribe_key => 'sub-c-53c3d30a-4135-11e3-9970-02ee2ddab7fe', :publish_key => 'pub-c-15d6fd3c-05de-4abc-8eba-6595a441959d', :secret_key => 'sec-c-ZWYwMGJiZTYtMTQwMC00NDQ5LWI0NmEtMzZiM2M5NThlOTJh', :error_callback => @error_callback)
28
+ @pn.uuid = 'f0ac67ef-912f-4797-be67-a59745107306'
29
+
30
+ Pubnub::Grant.any_instance.stub(:current_time).and_return 1234567890
31
+ Pubnub::Grant.any_instance.stub(:signature).and_return 'kdDh/sFC3rSR%2Bt5AEymIc57d1velIr562V7usa5M4k0='
32
+
33
+ end
34
+
35
+ it 'Works with given channel as string and presence as string' do
36
+ VCR.use_cassette("grant-multiple-channels-presence", :record => :none) do
37
+ @pn.grant(:ssl => true, :http_sync => true, :channel => "demo", :presence => "demo", :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,\"service\":\"Access Manager\",\"message\":\"Success\",\"payload\":{\"channels\":{\"demo\":{\"r\":1,\"w\":1},\"demo-pnpres\":{\"r\":1,\"w\":1}},\"subscribe_key\":\"sub-c-53c3d30a-4135-11e3-9970-02ee2ddab7fe\",\"ttl\":1440,\"level\":\"channel\"}}"
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 string and multiple presences as string' do
48
+ VCR.use_cassette("grant-multiple-channels-presence-multi-1", :record => :none) do
49
+ @pn.grant(:ssl => true, :http_sync => true, :channel => "demo,demo1,demo2", :presence => "demo,demo1,demo2", :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,\"service\":\"Access Manager\",\"message\":\"Success\",\"payload\":{\"channels\":{\"demo2-pnpres\":{\"r\":1,\"w\":1},\"demo\":{\"r\":1,\"w\":1},\"demo2\":{\"r\":1,\"w\":1},\"demo1\":{\"r\":1,\"w\":1},\"demo1-pnpres\":{\"r\":1,\"w\":1},\"demo-pnpres\":{\"r\":1,\"w\":1}},\"subscribe_key\":\"sub-c-53c3d30a-4135-11e3-9970-02ee2ddab7fe\",\"ttl\":1440,\"level\":\"channel\"}}"
54
+ @message_output.seek 0
55
+ @message_output.read.should eq 'Success'
56
+ end
57
+ end
58
+
59
+ it 'Works with given multiple channels as string and multiple presences as array' do
60
+ VCR.use_cassette("grant-multiple-channels-presence-multi-2", :record => :none) do
61
+ @pn.grant(:ssl => true, :http_sync => true, :channel => "demo,demo1,demo2", :presence => ["demo","demo1","demo2"], :write => true, :read => true, &@callback)
62
+
63
+ @after_callback.should eq true
64
+ @response_output.seek 0
65
+ @response_output.read.should eq "{\"status\":200,\"service\":\"Access Manager\",\"message\":\"Success\",\"payload\":{\"channels\":{\"demo2-pnpres\":{\"r\":1,\"w\":1},\"demo\":{\"r\":1,\"w\":1},\"demo2\":{\"r\":1,\"w\":1},\"demo1\":{\"r\":1,\"w\":1},\"demo1-pnpres\":{\"r\":1,\"w\":1},\"demo-pnpres\":{\"r\":1,\"w\":1}},\"subscribe_key\":\"sub-c-53c3d30a-4135-11e3-9970-02ee2ddab7fe\",\"ttl\":1440,\"level\":\"channel\"}}"
66
+ @message_output.seek 0
67
+ @message_output.read.should eq 'Success'
68
+ end
69
+ end
70
+
71
+ it 'Works with given multiple channels as array and multiple presences as string' do
72
+ VCR.use_cassette("grant-multiple-channels-presence-multi-3", :record => :none) do
73
+ @pn.grant(:ssl => true, :http_sync => true, :channel => ["demo","demo1","demo2"], :presence => "demo,demo1,demo2", :write => true, :read => true, &@callback)
74
+
75
+ @after_callback.should eq true
76
+ @response_output.seek 0
77
+ @response_output.read.should eq "{\"status\":200,\"service\":\"Access Manager\",\"message\":\"Success\",\"payload\":{\"channels\":{\"demo2-pnpres\":{\"r\":1,\"w\":1},\"demo\":{\"r\":1,\"w\":1},\"demo2\":{\"r\":1,\"w\":1},\"demo1\":{\"r\":1,\"w\":1},\"demo1-pnpres\":{\"r\":1,\"w\":1},\"demo-pnpres\":{\"r\":1,\"w\":1}},\"subscribe_key\":\"sub-c-53c3d30a-4135-11e3-9970-02ee2ddab7fe\",\"ttl\":1440,\"level\":\"channel\"}}"
78
+ @message_output.seek 0
79
+ @message_output.read.should eq 'Success'
80
+ end
81
+ end
82
+
83
+ it 'Works with given multiple channels as array and multiple presences as array' do
84
+ VCR.use_cassette("grant-multiple-channels-presence-multi-4", :record => :none) do
85
+ @pn.grant(:ssl => true, :http_sync => true, :channel => ["demo","demo1","demo2"], :presence => ["demo","demo1","demo2"], :write => true, :read => true, &@callback)
86
+
87
+ @after_callback.should eq true
88
+ @response_output.seek 0
89
+ @response_output.read.should eq "{\"status\":200,\"service\":\"Access Manager\",\"message\":\"Success\",\"payload\":{\"channels\":{\"demo2-pnpres\":{\"r\":1,\"w\":1},\"demo\":{\"r\":1,\"w\":1},\"demo2\":{\"r\":1,\"w\":1},\"demo1\":{\"r\":1,\"w\":1},\"demo1-pnpres\":{\"r\":1,\"w\":1},\"demo-pnpres\":{\"r\":1,\"w\":1}},\"subscribe_key\":\"sub-c-53c3d30a-4135-11e3-9970-02ee2ddab7fe\",\"ttl\":1440,\"level\":\"channel\"}}"
90
+ @message_output.seek 0
91
+ @message_output.read.should eq 'Success'
92
+ end
93
+ end
94
+ end
@@ -36,13 +36,12 @@ describe Pubnub::Client do
36
36
  end
37
37
  end
38
38
 
39
- it 'starts EventMachine reactor in a separate thread' do
39
+ it 'doesnt start EventMachine reactor' do
40
40
  pubnub = Pubnub.new(:subscribe_key => 'key')
41
41
  sleep(0.1)
42
- expect(EM.reactor_running?).to be true
43
- expect(EM.reactor_thread).not_to be eq Thread.current
42
+ expect(EM.reactor_running?).to eq(false)
44
43
  end
45
44
 
46
45
  end
47
46
 
48
- end
47
+ end
@@ -30,7 +30,7 @@ describe 'hearbeat' do
30
30
  it 'is called every heartbeat/2 - 1 seconds' do
31
31
  @pn = Pubnub.new(:subscribe_key => 'demo-36', :heartbeat => '12')
32
32
 
33
- VCR.use_cassette("heartbeat-test", :record => :all) do
33
+ VCR.use_cassette("heartbeat-test", :record => :none) do
34
34
  @pn.subscribe(:channel => 'rubyheartbeatdemo'){|e| }
35
35
  eventually do
36
36
  @pn.env[:heartbeat].to_i.should eq 12
@@ -39,21 +39,21 @@ describe 'hearbeat' do
39
39
  end
40
40
  end
41
41
 
42
- it 'calls error_callback if get\'s non-200 response' do
43
- @error = false
44
- error_callback = lambda do |error|
45
- @error = true
46
- EM.stop
47
- end
48
-
49
- @pn = Pubnub.new(:subscribe_key => 'demo-36', :heartbeat => '4', :error_callback => error_callback)
50
- VCR.use_cassette("heartbeat-non200", :record => :new_episodes) do
51
- @pn.subscribe(:channel => 'rubyheartbeatdemo'){|e| }
52
- eventually do
53
- @error.should eq true
54
- end
55
- end
56
- end
42
+ # it 'calls error_callback if get\'s non-200 response' do
43
+ # @error = false
44
+ # error_callback = lambda do |error|
45
+ # @error = true
46
+ # EM.stop
47
+ # end
48
+ #
49
+ # @pn = Pubnub.new(:subscribe_key => 'demo-36', :heartbeat => '4', :error_callback => error_callback)
50
+ # VCR.use_cassette("heartbeat-non200", :record => :new_episodes) do
51
+ # @pn.subscribe(:channel => 'rubyheartbeatdemo'){|e| }
52
+ # eventually do
53
+ # @error.should eq true
54
+ # end
55
+ # end
56
+ # end
57
57
 
58
58
  context 'is settable' do
59
59
  before(:each) do
@@ -42,7 +42,7 @@ describe "#here_now" do
42
42
  @response_output.seek 0
43
43
  @response_output.read.should eq '{"status": 200, "message": "OK", "service": "Presence", "uuids": [], "occupancy": 0}'
44
44
  @message_output.seek 0
45
- @message_output.read.should eq '{"status"=>200, "message"=>"OK", "service"=>"Presence", "uuids"=>[], "occupancy"=>0}'
45
+ @message_output.read.should eq 'OK'
46
46
  end
47
47
  end
48
48
  end
@@ -56,7 +56,7 @@ describe "#here_now" do
56
56
  @response_output.seek 0
57
57
  @response_output.read.should eq '{"status": 200, "message": "OK", "service": "Presence", "uuids": [], "occupancy": 0}'
58
58
  @message_output.seek 0
59
- @message_output.read.should eq '{"status"=>200, "message"=>"OK", "service"=>"Presence", "uuids"=>[], "occupancy"=>0}'
59
+ @message_output.read.should eq 'OK'
60
60
  end
61
61
  end
62
62
  end
@@ -168,7 +168,7 @@ describe "#here_now" do
168
168
  @response_output.seek 0
169
169
  @response_output.read.should eq '{"status": 200, "message": "OK", "service": "Presence", "uuids": [], "occupancy": 0}'
170
170
  @message_output.seek 0
171
- @message_output.read.should eq '{"status"=>200, "message"=>"OK", "service"=>"Presence", "uuids"=>[], "occupancy"=>0}'
171
+ @message_output.read.should eq 'OK'
172
172
  end
173
173
  end
174
174
  end
@@ -182,7 +182,7 @@ describe "#here_now" do
182
182
  @response_output.seek 0
183
183
  @response_output.read.should eq '{"status": 200, "message": "OK", "service": "Presence", "uuids": [], "occupancy": 0}'
184
184
  @message_output.seek 0
185
- @message_output.read.should eq '{"status"=>200, "message"=>"OK", "service"=>"Presence", "uuids"=>[], "occupancy"=>0}'
185
+ @message_output.read.should eq 'OK'
186
186
  end
187
187
  end
188
188
  end
@@ -230,7 +230,7 @@ describe "#here_now" do
230
230
  @response_output.seek 0
231
231
  @response_output.read.should eq '{"status": 200, "message": "OK", "service": "Presence", "uuids": [], "occupancy": 0'
232
232
  @message_output.seek 0
233
- @message_output.read.should eq '[0,"Invalid JSON in response."]'
233
+ @message_output.read.should eq "[0,\"Invalid JSON in response.\"]"
234
234
  end
235
235
  end
236
236
  end
@@ -244,7 +244,7 @@ describe "#here_now" do
244
244
  @response_output.seek 0
245
245
  @response_output.read.should eq '{"status": 200, "message": "OK", "service": "Presence", "uuids": [], "occupancy": 0'
246
246
  @message_output.seek 0
247
- @message_output.read.should eq '[0,"Invalid JSON in response."]'
247
+ @message_output.read.should eq "[0,\"Invalid JSON in response.\"]"
248
248
  end
249
249
  end
250
250
  end
@@ -297,7 +297,7 @@ describe "#here_now" do
297
297
  @response_output.seek 0
298
298
  @response_output.read.should eq '{"status": 200, "message": "OK", "service": "Presence", "uuids": [], "occupancy": 0}'
299
299
  @message_output.seek 0
300
- @message_output.read.should eq '{"status"=>200, "message"=>"OK", "service"=>"Presence", "uuids"=>[], "occupancy"=>0}'
300
+ @message_output.read.should eq 'OK'
301
301
  end
302
302
  end
303
303
  end
@@ -311,7 +311,7 @@ describe "#here_now" do
311
311
  @response_output.seek 0
312
312
  @response_output.read.should eq '{"status": 200, "message": "OK", "service": "Presence", "uuids": [], "occupancy": 0}'
313
313
  @message_output.seek 0
314
- @message_output.read.should eq '{"status"=>200, "message"=>"OK", "service"=>"Presence", "uuids"=>[], "occupancy"=>0}'
314
+ @message_output.read.should eq 'OK'
315
315
  end
316
316
  end
317
317
  end
@@ -423,7 +423,7 @@ describe "#here_now" do
423
423
  @response_output.seek 0
424
424
  @response_output.read.should eq '{"status": 200, "message": "OK", "service": "Presence", "uuids": [], "occupancy": 0}'
425
425
  @message_output.seek 0
426
- @message_output.read.should eq '{"status"=>200, "message"=>"OK", "service"=>"Presence", "uuids"=>[], "occupancy"=>0}'
426
+ @message_output.read.should eq 'OK'
427
427
  end
428
428
  end
429
429
  end
@@ -437,7 +437,7 @@ describe "#here_now" do
437
437
  @response_output.seek 0
438
438
  @response_output.read.should eq '{"status": 200, "message": "OK", "service": "Presence", "uuids": [], "occupancy": 0}'
439
439
  @message_output.seek 0
440
- @message_output.read.should eq '{"status"=>200, "message"=>"OK", "service"=>"Presence", "uuids"=>[], "occupancy"=>0}'
440
+ @message_output.read.should eq 'OK'
441
441
  end
442
442
  end
443
443
  end
@@ -42,7 +42,7 @@ describe "#here_now" do
42
42
  @response_output.seek 0
43
43
  @response_output.read.should eq '{"status": 200, "message": "OK", "service": "Presence", "uuids": [], "occupancy": 0}'
44
44
  @message_output.seek 0
45
- @message_output.read.should eq '{"status"=>200, "message"=>"OK", "service"=>"Presence", "uuids"=>[], "occupancy"=>0}'
45
+ @message_output.read.should eq 'OK'
46
46
  end
47
47
  end
48
48
  end
@@ -56,7 +56,7 @@ describe "#here_now" do
56
56
  @response_output.seek 0
57
57
  @response_output.read.should eq '{"status": 200, "message": "OK", "service": "Presence", "uuids": [], "occupancy": 0}'
58
58
  @message_output.seek 0
59
- @message_output.read.should eq '{"status"=>200, "message"=>"OK", "service"=>"Presence", "uuids"=>[], "occupancy"=>0}'
59
+ @message_output.read.should eq 'OK'
60
60
  end
61
61
  end
62
62
  end
@@ -168,7 +168,7 @@ describe "#here_now" do
168
168
  @response_output.seek 0
169
169
  @response_output.read.should eq '{"status": 200, "message": "OK", "service": "Presence", "uuids": [], "occupancy": 0}'
170
170
  @message_output.seek 0
171
- @message_output.read.should eq '{"status"=>200, "message"=>"OK", "service"=>"Presence", "uuids"=>[], "occupancy"=>0}'
171
+ @message_output.read.should eq 'OK'
172
172
  end
173
173
  end
174
174
  end
@@ -182,7 +182,7 @@ describe "#here_now" do
182
182
  @response_output.seek 0
183
183
  @response_output.read.should eq '{"status": 200, "message": "OK", "service": "Presence", "uuids": [], "occupancy": 0}'
184
184
  @message_output.seek 0
185
- @message_output.read.should eq '{"status"=>200, "message"=>"OK", "service"=>"Presence", "uuids"=>[], "occupancy"=>0}'
185
+ @message_output.read.should eq 'OK'
186
186
  end
187
187
  end
188
188
  end
@@ -297,7 +297,7 @@ describe "#here_now" do
297
297
  @response_output.seek 0
298
298
  @response_output.read.should eq '{"status": 200, "message": "OK", "service": "Presence", "uuids": [], "occupancy": 0}'
299
299
  @message_output.seek 0
300
- @message_output.read.should eq '{"status"=>200, "message"=>"OK", "service"=>"Presence", "uuids"=>[], "occupancy"=>0}'
300
+ @message_output.read.should eq 'OK'
301
301
  end
302
302
  end
303
303
  end
@@ -311,7 +311,7 @@ describe "#here_now" do
311
311
  @response_output.seek 0
312
312
  @response_output.read.should eq '{"status": 200, "message": "OK", "service": "Presence", "uuids": [], "occupancy": 0}'
313
313
  @message_output.seek 0
314
- @message_output.read.should eq '{"status"=>200, "message"=>"OK", "service"=>"Presence", "uuids"=>[], "occupancy"=>0}'
314
+ @message_output.read.should eq 'OK'
315
315
  end
316
316
  end
317
317
  end
@@ -423,7 +423,7 @@ describe "#here_now" do
423
423
  @response_output.seek 0
424
424
  @response_output.read.should eq '{"status": 200, "message": "OK", "service": "Presence", "uuids": [], "occupancy": 0}'
425
425
  @message_output.seek 0
426
- @message_output.read.should eq '{"status"=>200, "message"=>"OK", "service"=>"Presence", "uuids"=>[], "occupancy"=>0}'
426
+ @message_output.read.should eq 'OK'
427
427
  end
428
428
  end
429
429
  end
@@ -437,7 +437,7 @@ describe "#here_now" do
437
437
  @response_output.seek 0
438
438
  @response_output.read.should eq '{"status": 200, "message": "OK", "service": "Presence", "uuids": [], "occupancy": 0}'
439
439
  @message_output.seek 0
440
- @message_output.read.should eq '{"status"=>200, "message"=>"OK", "service"=>"Presence", "uuids"=>[], "occupancy"=>0}'
440
+ @message_output.read.should eq 'OK'
441
441
  end
442
442
  end
443
443
  end
@@ -40,9 +40,9 @@ describe "#here_now" do
40
40
 
41
41
  @after_callback.should eq true
42
42
  @response_output.seek 0
43
- @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
43
+ @response_output.read.should eq "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\", \"uuids\": [\"rubytest\"], \"occupancy\": 1}"
44
44
  @message_output.seek 0
45
- @message_output.read.should eq '{"uuids"=>["rubytests"], "occupancy"=>1}'
45
+ @message_output.read.should eq 'OK'
46
46
  end
47
47
  end
48
48
  end
@@ -54,9 +54,9 @@ describe "#here_now" do
54
54
  eventually do
55
55
  @after_callback.should eq true
56
56
  @response_output.seek 0
57
- @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
57
+ @response_output.read.should eq "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\", \"uuids\": [\"rubytest\"], \"occupancy\": 1}"
58
58
  @message_output.seek 0
59
- @message_output.read.should eq '{"uuids"=>["rubytests"], "occupancy"=>1}'
59
+ @message_output.read.should eq 'OK'
60
60
  end
61
61
  end
62
62
  end
@@ -70,7 +70,7 @@ describe "#here_now" do
70
70
 
71
71
  @after_error_callback.should eq true
72
72
  @response_output.seek 0
73
- @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
73
+ @response_output.read.should eq "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\", \"uuids\": [\"rubytest\"], \"occupancy\": 1}"
74
74
  @message_output.seek 0
75
75
  @message_output.read.should eq '[0,"Non 2xx server response."]'
76
76
  end
@@ -84,7 +84,7 @@ describe "#here_now" do
84
84
  eventually do
85
85
  @after_error_callback.should eq true
86
86
  @response_output.seek 0
87
- @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
87
+ @response_output.read.should eq "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\", \"uuids\": [\"rubytest\"], \"occupancy\": 1}"
88
88
  @message_output.seek 0
89
89
  @message_output.read.should eq '[0,"Non 2xx server response."]'
90
90
  end
@@ -166,9 +166,9 @@ describe "#here_now" do
166
166
 
167
167
  @after_callback.should eq true
168
168
  @response_output.seek 0
169
- @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
169
+ @response_output.read.should eq "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\", \"uuids\": [\"rubytest\"], \"occupancy\": 1}"
170
170
  @message_output.seek 0
171
- @message_output.read.should eq '{"uuids"=>["rubytests"], "occupancy"=>1}'
171
+ @message_output.read.should eq 'OK'
172
172
  end
173
173
  end
174
174
  end
@@ -180,9 +180,9 @@ describe "#here_now" do
180
180
  eventually do
181
181
  @after_callback.should eq true
182
182
  @response_output.seek 0
183
- @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
183
+ @response_output.read.should eq "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\", \"uuids\": [\"rubytest\"], \"occupancy\": 1}"
184
184
  @message_output.seek 0
185
- @message_output.read.should eq '{"uuids"=>["rubytests"], "occupancy"=>1}'
185
+ @message_output.read.should eq 'OK'
186
186
  end
187
187
  end
188
188
  end
@@ -196,7 +196,7 @@ describe "#here_now" do
196
196
 
197
197
  @after_error_callback.should eq true
198
198
  @response_output.seek 0
199
- @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
199
+ @response_output.read.should eq "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\", \"uuids\": [\"rubytest\"], \"occupancy\": 1}"
200
200
  @message_output.seek 0
201
201
  @message_output.read.should eq '[0,"Non 2xx server response."]'
202
202
  end
@@ -210,7 +210,7 @@ describe "#here_now" do
210
210
  eventually do
211
211
  @after_error_callback.should eq true
212
212
  @response_output.seek 0
213
- @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
213
+ @response_output.read.should eq "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\", \"uuids\": [\"rubytest\"], \"occupancy\": 1}"
214
214
  @message_output.seek 0
215
215
  @message_output.read.should eq '[0,"Non 2xx server response."]'
216
216
  end
@@ -295,9 +295,9 @@ describe "#here_now" do
295
295
 
296
296
  @after_callback.should eq true
297
297
  @response_output.seek 0
298
- @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
298
+ @response_output.read.should eq "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\", \"uuids\": [\"rubytest\"], \"occupancy\": 1}"
299
299
  @message_output.seek 0
300
- @message_output.read.should eq '{"uuids"=>["rubytests"], "occupancy"=>1}'
300
+ @message_output.read.should eq 'OK'
301
301
  end
302
302
  end
303
303
  end
@@ -309,9 +309,9 @@ describe "#here_now" do
309
309
  eventually do
310
310
  @after_callback.should eq true
311
311
  @response_output.seek 0
312
- @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
312
+ @response_output.read.should eq "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\", \"uuids\": [\"rubytest\"], \"occupancy\": 1}"
313
313
  @message_output.seek 0
314
- @message_output.read.should eq '{"uuids"=>["rubytests"], "occupancy"=>1}'
314
+ @message_output.read.should eq 'OK'
315
315
  end
316
316
  end
317
317
  end
@@ -325,7 +325,7 @@ describe "#here_now" do
325
325
 
326
326
  @after_error_callback.should eq true
327
327
  @response_output.seek 0
328
- @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
328
+ @response_output.read.should eq "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\", \"uuids\": [\"rubytest\"], \"occupancy\": 1}"
329
329
  @message_output.seek 0
330
330
  @message_output.read.should eq '[0,"Non 2xx server response."]'
331
331
  end
@@ -339,7 +339,7 @@ describe "#here_now" do
339
339
  eventually do
340
340
  @after_error_callback.should eq true
341
341
  @response_output.seek 0
342
- @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
342
+ @response_output.read.should eq "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\", \"uuids\": [\"rubytest\"], \"occupancy\": 1}"
343
343
  @message_output.seek 0
344
344
  @message_output.read.should eq '[0,"Non 2xx server response."]'
345
345
  end
@@ -423,9 +423,9 @@ describe "#here_now" do
423
423
 
424
424
  @after_callback.should eq true
425
425
  @response_output.seek 0
426
- @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
426
+ @response_output.read.should eq "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\", \"uuids\": [\"rubytest\"], \"occupancy\": 1}"
427
427
  @message_output.seek 0
428
- @message_output.read.should eq '{"uuids"=>["rubytests"], "occupancy"=>1}'
428
+ @message_output.read.should eq 'OK'
429
429
  end
430
430
  end
431
431
  end
@@ -437,9 +437,9 @@ describe "#here_now" do
437
437
  eventually do
438
438
  @after_callback.should eq true
439
439
  @response_output.seek 0
440
- @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
440
+ @response_output.read.should eq "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\", \"uuids\": [\"rubytest\"], \"occupancy\": 1}"
441
441
  @message_output.seek 0
442
- @message_output.read.should eq '{"uuids"=>["rubytests"], "occupancy"=>1}'
442
+ @message_output.read.should eq 'OK'
443
443
  end
444
444
  end
445
445
  end
@@ -453,7 +453,7 @@ describe "#here_now" do
453
453
 
454
454
  @after_error_callback.should eq true
455
455
  @response_output.seek 0
456
- @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
456
+ @response_output.read.should eq "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\", \"uuids\": [\"rubytest\"], \"occupancy\": 1}"
457
457
  @message_output.seek 0
458
458
  @message_output.read.should eq '[0,"Non 2xx server response."]'
459
459
  end
@@ -467,7 +467,7 @@ describe "#here_now" do
467
467
  eventually do
468
468
  @after_error_callback.should eq true
469
469
  @response_output.seek 0
470
- @response_output.read.should eq '{"uuids":["rubytests"],"occupancy":1}'
470
+ @response_output.read.should eq "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\", \"uuids\": [\"rubytest\"], \"occupancy\": 1}"
471
471
  @message_output.seek 0
472
472
  @message_output.read.should eq '[0,"Non 2xx server response."]'
473
473
  end