pubnub 4.0.27 → 4.0.28

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.

Potentially problematic release.


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

Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/.pubnub.yml +8 -1
  3. data/.rubocop.yml +9 -3
  4. data/.travis.yml +6 -19
  5. data/CHANGELOG.md +86 -82
  6. data/Gemfile +7 -5
  7. data/Gemfile.lock +155 -157
  8. data/README.md +34 -34
  9. data/VERSION +1 -1
  10. data/gemfiles/celluloid_017.gemfile +4 -4
  11. data/gemfiles/celluloid_018.gemfile +4 -4
  12. data/gemfiles/celluloid_master.gemfile +4 -4
  13. data/gemfiles/concurrent-ruby-1.0.5.gem +0 -0
  14. data/gemfiles/concurrent-ruby-edge-0.3.1.gem +0 -0
  15. data/lib/pubnub.rb +3 -3
  16. data/lib/pubnub/client.rb +19 -16
  17. data/lib/pubnub/client/events.rb +5 -5
  18. data/lib/pubnub/client/getters_setters.rb +11 -12
  19. data/lib/pubnub/client/paged_history.rb +11 -9
  20. data/lib/pubnub/configuration.rb +1 -2
  21. data/lib/pubnub/constants.rb +47 -47
  22. data/lib/pubnub/crypto.rb +2 -2
  23. data/lib/pubnub/envelope.rb +7 -5
  24. data/lib/pubnub/error.rb +22 -15
  25. data/lib/pubnub/event.rb +24 -25
  26. data/lib/pubnub/event/formatter.rb +8 -5
  27. data/lib/pubnub/event/signature.rb +3 -3
  28. data/lib/pubnub/events/audit.rb +1 -1
  29. data/lib/pubnub/events/channel_registration.rb +10 -15
  30. data/lib/pubnub/events/delete_messages.rb +9 -9
  31. data/lib/pubnub/events/grant.rb +3 -3
  32. data/lib/pubnub/events/heartbeat.rb +4 -8
  33. data/lib/pubnub/events/here_now.rb +4 -8
  34. data/lib/pubnub/events/history.rb +10 -10
  35. data/lib/pubnub/events/leave.rb +2 -2
  36. data/lib/pubnub/events/presence.rb +1 -1
  37. data/lib/pubnub/events/publish.rb +3 -5
  38. data/lib/pubnub/events/revoke.rb +3 -3
  39. data/lib/pubnub/events/set_state.rb +3 -3
  40. data/lib/pubnub/events/state.rb +4 -6
  41. data/lib/pubnub/events/subscribe.rb +1 -1
  42. data/lib/pubnub/events/time.rb +2 -2
  43. data/lib/pubnub/events/where_now.rb +6 -6
  44. data/lib/pubnub/format.rb +73 -0
  45. data/lib/pubnub/formatter.rb +23 -21
  46. data/lib/pubnub/heart.rb +4 -4
  47. data/lib/pubnub/origin_manager.rb +3 -5
  48. data/lib/pubnub/pam.rb +5 -5
  49. data/lib/pubnub/schemas/envelope_schema.rb +1 -1
  50. data/lib/pubnub/subscribe_callback.rb +3 -3
  51. data/lib/pubnub/subscribe_event.rb +6 -10
  52. data/lib/pubnub/subscribe_event/formatter.rb +82 -80
  53. data/lib/pubnub/subscribe_event/heartbeat.rb +1 -1
  54. data/lib/pubnub/subscriber.rb +31 -32
  55. data/lib/pubnub/telemetry.rb +26 -27
  56. data/lib/pubnub/validators/audit.rb +3 -2
  57. data/lib/pubnub/validators/channel_registration.rb +6 -4
  58. data/lib/pubnub/validators/client.rb +1 -0
  59. data/lib/pubnub/validators/common_validator.rb +37 -31
  60. data/lib/pubnub/validators/delete.rb +5 -4
  61. data/lib/pubnub/validators/grant.rb +3 -2
  62. data/lib/pubnub/validators/history.rb +3 -2
  63. data/lib/pubnub/validators/leave.rb +3 -2
  64. data/lib/pubnub/validators/presence.rb +3 -2
  65. data/lib/pubnub/validators/publish.rb +15 -10
  66. data/lib/pubnub/validators/set_state.rb +0 -2
  67. data/lib/pubnub/validators/state.rb +3 -2
  68. data/lib/pubnub/version.rb +1 -1
  69. data/pubnub.gemspec +19 -18
  70. data/spec/examples/audit_examples_spec.rb +1268 -1418
  71. data/spec/examples/channel_registration_examples_spec.rb +655 -757
  72. data/spec/examples/delete_messages_examples_spec.rb +19 -21
  73. data/spec/examples/grant_examples_spec.rb +34028 -37920
  74. data/spec/examples/heartbeat_examples_spec.rb +583 -731
  75. data/spec/examples/here_now_examples_spec.rb +493 -569
  76. data/spec/examples/history_examples_spec.rb +979 -1127
  77. data/spec/examples/leave_examples_spec.rb +439 -551
  78. data/spec/examples/presence_examples_spec.rb +686 -830
  79. data/spec/examples/publish_examples_spec.rb +27223 -31547
  80. data/spec/examples/publish_with_ttl_spec.rb +11 -14
  81. data/spec/examples/revoke_examples_spec.rb +68048 -75828
  82. data/spec/examples/set_state_examples_spec.rb +295 -371
  83. data/spec/examples/state_examples_spec.rb +169 -197
  84. data/spec/examples/status_request_message_count_exceeded_spec.rb +16 -19
  85. data/spec/examples/subscribe_examples_spec.rb +43843 -52035
  86. data/spec/examples/time_examples_spec.rb +82 -98
  87. data/spec/examples/where_now_examples_spec.rb +88 -104
  88. data/spec/lib/client_spec.rb +99 -117
  89. data/spec/lib/connection_callback_spec.rb +27 -33
  90. data/spec/lib/custom_retries_examples_spec.rb +8 -11
  91. data/spec/lib/event_spec.rb +35 -42
  92. data/spec/lib/events/audit_spec.rb +19 -25
  93. data/spec/lib/events/channel_registration_spec.rb +17 -23
  94. data/spec/lib/events/delete_messages_spec.rb +14 -20
  95. data/spec/lib/events/grant_spec.rb +15 -21
  96. data/spec/lib/events/heartbeat_spec.rb +21 -27
  97. data/spec/lib/events/here_now_spec.rb +14 -20
  98. data/spec/lib/events/history_spec.rb +14 -20
  99. data/spec/lib/events/leave_spec.rb +14 -20
  100. data/spec/lib/events/presence_delta_spec.rb +15 -16
  101. data/spec/lib/events/presence_spec.rb +36 -45
  102. data/spec/lib/events/publish_spec.rb +33 -40
  103. data/spec/lib/events/revoke_spec.rb +16 -22
  104. data/spec/lib/events/state_spec.rb +16 -22
  105. data/spec/lib/events/subscribe_spec.rb +75 -85
  106. data/spec/lib/events/time_spec.rb +12 -18
  107. data/spec/lib/events/timeout_handling_spec.rb +8 -14
  108. data/spec/lib/events/where_now_spec.rb +14 -20
  109. data/spec/lib/keep_alive_spec.rb +4 -8
  110. data/spec/lib/multiple_ciphers_spec.rb +56 -60
  111. data/spec/lib/pubnub_spec.rb +10 -13
  112. data/spec/lib/signatures_spec.rb +118 -120
  113. data/spec/lib/ssl_error_spec.rb +14 -18
  114. data/spec/lib/super_admin_spec.rb +58 -66
  115. data/spec/lib/uuid_spec.rb +3 -4
  116. data/spec/spec_expectations.rb +3 -3
  117. data/spec/spec_helper.rb +29 -46
  118. metadata +52 -22
  119. data/lib/pubnub/message.rb +0 -43
@@ -1,70 +1,64 @@
1
- require 'spec_helper'
2
-
3
- describe 'Connect, disconnect and reconnect callbacks' do
1
+ require "spec_helper"
4
2
 
3
+ describe "Connect, disconnect and reconnect callbacks" do
5
4
  around :each do |example|
6
- Celluloid.boot
7
- example.run
8
- Celluloid.shutdown
5
+ example.run_with_retry retry: 10
9
6
  end
10
7
 
11
8
  before(:each) do
12
9
  @connect_messages, @reconnect_messages, @disconnect_messages = [], [], []
13
10
 
14
11
  callback = Pubnub::SubscribeCallback.new(
15
- message: ->(_envelope) { },
16
- presence: ->(_envelope) { },
17
- status: lambda do |envelope|
18
-
19
- if envelope.error?
20
- @disconnect_messages << envelope
21
- else
22
- if envelope.status[:last_timetoken] == 0 && !@disconnect_messages.empty?
23
- @reconnect_messages << envelope
24
- elsif envelope.status[:last_timetoken] == 0 # Connected!
25
- @connect_messages << envelope
26
- @pubnub.leave(channel: :demo)
27
- end
12
+ message: -> (_envelope) { },
13
+ presence: -> (_envelope) { },
14
+ status: lambda do |envelope|
15
+ if envelope.error?
16
+ @disconnect_messages << envelope
17
+ else
18
+ if envelope.status[:last_timetoken] == 0 && !@disconnect_messages.empty?
19
+ @reconnect_messages << envelope
20
+ elsif envelope.status[:last_timetoken] == 0 # Connected!
21
+ @connect_messages << envelope
22
+ @pubnub.leave(channel: :demo)
28
23
  end
29
24
  end
25
+ end,
30
26
  )
31
27
 
32
28
  @pubnub = Pubnub.new(
33
- subscribe_key: :demo,
34
- publish_key: :demo,
35
- reconnect_interval: 0
29
+ subscribe_key: :demo,
30
+ publish_key: :demo,
31
+ reconnect_interval: 0,
36
32
  )
37
33
 
38
34
  @pubnub.add_listener(callback: callback)
39
35
  end
40
36
 
41
- it 'fire connect callback when connection is made' do
42
- VCR.use_cassette('client/connection_callbacks_0', :record => :once) do
37
+ it "fire connect callback when connection is made" do
38
+ VCR.use_cassette("client/connection_callbacks_0", :record => :once) do
43
39
  @pubnub.subscribe(channel: :demo)
44
40
  sleep 0.5
45
41
  expect(@connect_messages.size).to be > 0
46
42
  end
47
43
  end
48
44
 
49
- it 'fire status callback when connection is lost' do
45
+ it "fire status callback when connection is lost" do
46
+ Pubnub::SubscribeEvent.any_instance.stub(:request_dispatcher) { Pubnub::SubscribeEvent.any_instance.unstub(:request_dispatcher); raise "error" }
50
47
 
51
- Pubnub::SubscribeEvent.any_instance.stub(:request_dispatcher) { Pubnub::SubscribeEvent.any_instance.unstub(:request_dispatcher); raise 'error' }
52
-
53
- VCR.use_cassette('client/connection_callbacks_1', :record => :once) do
48
+ VCR.use_cassette("client/connection_callbacks_1", :record => :once) do
54
49
  @pubnub.subscribe(channel: :demo)
55
50
  sleep 0.5
56
51
  expect(@disconnect_messages.size).to be > 0
57
52
  end
58
53
  end
59
54
 
60
- it 'fire reconnect callback when connection is reestablished' do
61
- Pubnub::SubscribeEvent.any_instance.stub(:request_dispatcher) { Pubnub::SubscribeEvent.any_instance.unstub(:request_dispatcher); raise 'error' }
55
+ it "fire reconnect callback when connection is reestablished" do
56
+ Pubnub::SubscribeEvent.any_instance.stub(:request_dispatcher) { Pubnub::SubscribeEvent.any_instance.unstub(:request_dispatcher); raise "error" }
62
57
 
63
- VCR.use_cassette('client/connection_callbacks_2', :record => :once) do
58
+ VCR.use_cassette("client/connection_callbacks_2", :record => :once) do
64
59
  @pubnub.subscribe(channel: :demo)
65
60
  sleep 0.5
66
61
  expect(@reconnect_messages.size).to be > 0
67
62
  end
68
63
  end
69
-
70
- end
64
+ end
@@ -1,19 +1,16 @@
1
- require 'spec_helper'
2
-
3
- describe 'Custom retries' do
1
+ require "spec_helper"
4
2
 
3
+ describe "Custom retries" do
5
4
  around :each do |example|
6
- Celluloid.boot
7
- example.run
8
- Celluloid.shutdown
5
+ example.run_with_retry retry: 10
9
6
  end
10
7
 
11
8
  before(:each) do
12
9
  @pubnub = Pubnub.new(
13
- subscribe_key: 'sub-c-446d9780-c606-11e5-a316-0619f8945a4f',
14
- publish_key: 'pub-c-63eb50a0-98ed-43b2-999a-c32efb85c747',
15
- secret_key: 'sec-c-MTQyMzhjZGUtNTJiYi00MDU0LThkZWQtZDRmMGUwZDk4NjQz',
16
- uuid: 'ruby-test-client'
10
+ subscribe_key: "sub-c-446d9780-c606-11e5-a316-0619f8945a4f",
11
+ publish_key: "pub-c-63eb50a0-98ed-43b2-999a-c32efb85c747",
12
+ secret_key: "sec-c-MTQyMzhjZGUtNTJiYi00MDU0LThkZWQtZDRmMGUwZDk4NjQz",
13
+ uuid: "ruby-test-client",
17
14
  )
18
15
  end
19
16
 
@@ -57,4 +54,4 @@ describe 'Custom retries' do
57
54
  # expect(@success_envelope.timetoken).to eq '14573583203711342'
58
55
  # end
59
56
 
60
- end
57
+ end
@@ -1,86 +1,79 @@
1
- require 'spec_helper'
2
-
3
- shared_examples 'an event' do
1
+ require "spec_helper"
4
2
 
3
+ shared_examples "an event" do
5
4
  around :each do |example|
6
- Celluloid.boot
7
- example.run
8
- Celluloid.shutdown
5
+ example.run_with_retry retry: 10
9
6
  end
10
7
 
11
- it 'is a Celluloid actor' do
8
+ it "is async" do
12
9
  expect(
13
- described_class.ancestors
14
- .select { |o| o.class == Module }.include? Celluloid
10
+ described_class.ancestors
11
+ .select { |o| o.class == Module }.include? Concurrent::Async
15
12
  ).to eq true
16
13
  end
17
14
 
18
- context '#initialize' do
19
- let(:pubnub_client) { Pubnub.new(subscribe_key: 'demo') }
15
+ context "#initialize" do
16
+ let(:pubnub_client) { Pubnub.new(subscribe_key: "demo") }
20
17
 
21
- it 'sets :channel_group parameter as @group internal variable' do
22
- event = described_class.new({ channel_group: 'somegroup', skip_validate: true }, pubnub_client)
23
- expect(event.instance_variable_get(:@group)).to eq ['somegroup']
18
+ it "sets :channel_group parameter as @group internal variable" do
19
+ event = described_class.new({channel_group: "somegroup", skip_validate: true}, pubnub_client)
20
+ expect(event.instance_variable_get(:@group)).to eq ["somegroup"]
24
21
  end
25
22
 
26
- it 'sets Pubnub::Client as @app' do
27
- event = described_class.new({ channel: 'channel', skip_validate: true }, pubnub_client)
28
- expect(event.instance_variable_get('@app')).to eq pubnub_client
23
+ it "sets Pubnub::Client as @app" do
24
+ event = described_class.new({channel: "channel", skip_validate: true}, pubnub_client)
25
+ expect(event.instance_variable_get("@app")).to eq pubnub_client
29
26
  end
30
27
 
31
- it 'logs when initialized' do
28
+ it "logs when initialized" do
32
29
  rd, wr = IO.pipe
33
30
  logger = Logger.new(wr)
34
31
  pubnub = Pubnub.new(subscribe_key: :key, logger: logger)
35
32
 
36
- described_class.new({ channel: 'channel', skip_validate: true }, pubnub)
33
+ described_class.new({channel: "channel", skip_validate: true}, pubnub)
37
34
 
38
35
  wr.close
39
36
  messages = rd.read
40
37
 
41
- expect(messages)
42
- .to match(/.*Initialized\s#{described_class}.*/)
38
+ expect(messages).to match(/.*Initialized\s#{described_class}.*/)
43
39
  end
44
40
 
45
-
46
- it 'creates specific instance variables from options' do
41
+ it "creates specific instance variables from options" do
47
42
  vars = [:@origin, :@channel, :@message, :@http_sync, :@callback,
48
43
  :@ssl, :@cipher_key,
49
44
  :@secret_key, :@auth_key, :@publish_key, :@subscribe_key,
50
45
  :@timetoken, :@channels, :@customs]
51
46
 
52
- event = described_class.new({ channel: 'channel', skip_validate: true }, pubnub_client)
47
+ event = described_class.new({channel: "channel", skip_validate: true}, pubnub_client)
53
48
  expect(vars - event.instance_variables).to eq []
54
49
  end
55
50
 
56
- context 'variables' do
57
- it 'merges variables from app and options' do
58
- event = described_class.new({ channel: 'chan', skip_validate: true }, pubnub_client)
59
- expect(event.instance_variable_get(:@subscribe_key)).to eq 'demo'
51
+ context "variables" do
52
+ it "merges variables from app and options" do
53
+ event = described_class.new({channel: "chan", skip_validate: true}, pubnub_client)
54
+ expect(event.instance_variable_get(:@subscribe_key)).to eq "demo"
60
55
  if described_class == Pubnub::Presence
61
- expect(event.instance_variable_get(:@channel)).to eq ['chan-pnpres']
56
+ expect(event.instance_variable_get(:@channel)).to eq ["chan-pnpres"]
62
57
  else
63
- expect(event.instance_variable_get(:@channel)).to eq ['chan']
58
+ expect(event.instance_variable_get(:@channel)).to eq ["chan"]
64
59
  end
65
60
  end
66
61
 
67
- it 'merges variables from app and options overwriting apps' do
68
- event = described_class.new({ subscribe_key: 'key', skip_validate: true }, pubnub_client)
69
- expect(event.instance_variable_get(:@subscribe_key)).to eq 'key'
62
+ it "merges variables from app and options overwriting apps" do
63
+ event = described_class.new({subscribe_key: "key", skip_validate: true}, pubnub_client)
64
+ expect(event.instance_variable_get(:@subscribe_key)).to eq "key"
70
65
  end
71
66
 
72
- context '@channel' do
67
+ context "@channel" do
73
68
  if described_class == Pubnub::Presence
74
- it 'is set properly when passed as :channels' do
75
- event = described_class.new({ channels: 'chan', skip_validate: true }, pubnub_client)
76
- expect(event.instance_variable_get(:@channel))
77
- .to eq ['chan-pnpres']
69
+ it "is set properly when passed as :channels" do
70
+ event = described_class.new({channels: "chan", skip_validate: true}, pubnub_client)
71
+ expect(event.instance_variable_get(:@channel)).to eq ["chan-pnpres"]
78
72
  end
79
73
 
80
- it 'is formatted to be an array' do
81
- event = described_class.new({ channel: 'chan', skip_validate: true }, pubnub_client)
82
- expect(event.instance_variable_get(:@channel).class)
83
- .to eq Array
74
+ it "is formatted to be an array" do
75
+ event = described_class.new({channel: "chan", skip_validate: true}, pubnub_client)
76
+ expect(event.instance_variable_get(:@channel).class).to eq Array
84
77
  end
85
78
 
86
79
  # it 'is formatted when given as string' do
@@ -1,32 +1,26 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  describe Pubnub::Audit do
4
- it_behaves_like 'an event'
4
+ it_behaves_like "an event"
5
5
 
6
- around :each do |example|
7
- Celluloid.boot
8
- example.run
9
- Celluloid.shutdown
10
- end
11
-
12
- context 'given basic parameters' do
6
+ context "given basic parameters" do
13
7
  before :each do
14
8
  Pubnub::Audit.any_instance.stub(:current_time).and_return 1462972157
15
- Pubnub::Audit.any_instance.stub(:signature).and_return 'P3xhzqxwFJSFthJbnByZog-U4j1S5TMFeuUxqKNgMM0='
9
+ Pubnub::Audit.any_instance.stub(:signature).and_return "P3xhzqxwFJSFthJbnByZog-U4j1S5TMFeuUxqKNgMM0="
16
10
 
17
11
  @pubnub = Pubnub::Client.new(
18
- subscribe_key: 'sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f',
19
- publish_key: 'pub-c-b42cec2f-f468-4784-8833-dd2b074538c4',
20
- secret_key: 'sec-c-OWIyYmVlYWYtYWMxMS00OTcxLTlhZDAtZDBlYTM4ODE1MWUy',
21
- auth_key: 'ruby-test-auth',
22
- uuid: 'ruby-test-uuid'
12
+ subscribe_key: "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f",
13
+ publish_key: "pub-c-b42cec2f-f468-4784-8833-dd2b074538c4",
14
+ secret_key: "sec-c-OWIyYmVlYWYtYWMxMS00OTcxLTlhZDAtZDBlYTM4ODE1MWUy",
15
+ auth_key: "ruby-test-auth",
16
+ uuid: "ruby-test-uuid",
23
17
  )
24
18
  end
25
19
 
26
- it 'works' do
27
- VCR.use_cassette('lib/events/audit-works', record: :once) do
20
+ it "works" do
21
+ VCR.use_cassette("lib/events/audit-works", record: :once) do
28
22
  envelope = @pubnub.audit(
29
- channel: :demo
23
+ channel: :demo,
30
24
  ).value
31
25
 
32
26
  expect(envelope.status).to satisfies_schema Pubnub::Schemas::Envelope::StatusSchema
@@ -34,10 +28,10 @@ describe Pubnub::Audit do
34
28
  end
35
29
  end
36
30
 
37
- it 'forms valid ErrorEnvelope on error' do
38
- VCR.use_cassette('lib/events/audit-error', record: :once) do
31
+ it "forms valid ErrorEnvelope on error" do
32
+ VCR.use_cassette("lib/events/audit-error", record: :once) do
39
33
  envelope = @pubnub.audit(
40
- channel: :demo
34
+ channel: :demo,
41
35
  ).value
42
36
 
43
37
  expect(envelope.is_a?(Pubnub::ErrorEnvelope)).to eq true
@@ -46,10 +40,10 @@ describe Pubnub::Audit do
46
40
  end
47
41
  end
48
42
 
49
- it 'forms valid ErrorEnvelope on json error' do
50
- VCR.use_cassette('lib/events/audit-json-error', record: :once) do
43
+ it "forms valid ErrorEnvelope on json error" do
44
+ VCR.use_cassette("lib/events/audit-json-error", record: :once) do
51
45
  envelope = @pubnub.audit(
52
- channel: :demo
46
+ channel: :demo,
53
47
  ).value
54
48
 
55
49
  expect(envelope.is_a?(Pubnub::ErrorEnvelope)).to eq true
@@ -58,4 +52,4 @@ describe Pubnub::Audit do
58
52
  end
59
53
  end
60
54
  end
61
- end
55
+ end
@@ -1,30 +1,24 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  describe Pubnub::ChannelRegistration do
4
4
  # it_behaves_like 'an event'
5
5
 
6
- around :each do |example|
7
- Celluloid.boot
8
- example.run
9
- Celluloid.shutdown
10
- end
11
-
12
- context 'given basic parameters' do
6
+ context "given basic parameters" do
13
7
  before :each do
14
8
  @pubnub = Pubnub::Client.new(
15
- subscribe_key: 'sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f',
16
- publish_key: 'pub-c-b42cec2f-f468-4784-8833-dd2b074538c4',
17
- auth_key: 'ruby-test-auth',
18
- uuid: 'ruby-test-uuid'
9
+ subscribe_key: "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f",
10
+ publish_key: "pub-c-b42cec2f-f468-4784-8833-dd2b074538c4",
11
+ auth_key: "ruby-test-auth",
12
+ uuid: "ruby-test-uuid",
19
13
  )
20
14
  end
21
15
 
22
- it 'works' do
23
- VCR.use_cassette('lib/events/channel-registration', record: :once) do
16
+ it "works" do
17
+ VCR.use_cassette("lib/events/channel-registration", record: :once) do
24
18
  envelope = @pubnub.channel_registration(
25
- action: :add,
26
- channel: :demo,
27
- group: :demo
19
+ action: :add,
20
+ channel: :demo,
21
+ group: :demo,
28
22
  ).value
29
23
 
30
24
  expect(envelope.status).to satisfies_schema Pubnub::Schemas::Envelope::StatusSchema
@@ -32,12 +26,12 @@ describe Pubnub::ChannelRegistration do
32
26
  end
33
27
  end
34
28
 
35
- it 'forms valid ErrorEnvelope on error' do
36
- VCR.use_cassette('lib/events/channel-registration-error', record: :once) do
29
+ it "forms valid ErrorEnvelope on error" do
30
+ VCR.use_cassette("lib/events/channel-registration-error", record: :once) do
37
31
  envelope = @pubnub.channel_registration(
38
- action: :add,
39
- channel: :demo,
40
- group: :demo
32
+ action: :add,
33
+ channel: :demo,
34
+ group: :demo,
41
35
  ).value
42
36
 
43
37
  expect(envelope.is_a?(Pubnub::ErrorEnvelope)).to eq true
@@ -45,4 +39,4 @@ describe Pubnub::ChannelRegistration do
45
39
  end
46
40
  end
47
41
  end
48
- end
42
+ end
@@ -1,38 +1,32 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  describe Pubnub::DeleteMessages do
4
- it_behaves_like 'an event'
4
+ it_behaves_like "an event"
5
5
 
6
- around :each do |example|
7
- Celluloid.boot
8
- example.run
9
- Celluloid.shutdown
10
- end
11
-
12
- context 'given basic parameters' do
6
+ context "given basic parameters" do
13
7
  before :each do
14
8
  @pubnub = Pubnub::Client.new(
15
- subscribe_key: 'sub-c-fc6c9226-655d-11e7-b272-02ee2ddab7fe',
16
- publish_key: 'pub-c-b458bb23-c95d-4f43-9992-e2c118557e80',
17
- auth_key: 'ruby-test-auth',
18
- uuid: 'ruby-test-uuid'
9
+ subscribe_key: "sub-c-fc6c9226-655d-11e7-b272-02ee2ddab7fe",
10
+ publish_key: "pub-c-b458bb23-c95d-4f43-9992-e2c118557e80",
11
+ auth_key: "ruby-test-auth",
12
+ uuid: "ruby-test-uuid",
19
13
  )
20
14
  end
21
15
 
22
- it 'works' do
23
- VCR.use_cassette('lib/events/delete_messages', record: :once) do
16
+ it "works" do
17
+ VCR.use_cassette("lib/events/delete_messages", record: :once) do
24
18
  envelope = @pubnub.delete_messages(
25
- channel: :demo
19
+ channel: :demo,
26
20
  ).value
27
21
 
28
22
  expect(envelope.status).to satisfies_schema Pubnub::Schemas::Envelope::StatusSchema
29
23
  end
30
24
  end
31
25
 
32
- it 'forms valid ErrorEnvelope on error' do
33
- VCR.use_cassette('lib/events/delete_messages-error', record: :once) do
26
+ it "forms valid ErrorEnvelope on error" do
27
+ VCR.use_cassette("lib/events/delete_messages-error", record: :once) do
34
28
  envelope = @pubnub.delete_messages(
35
- channel: :demo
29
+ channel: :demo,
36
30
  ).value
37
31
 
38
32
  expect(envelope.is_a?(Pubnub::ErrorEnvelope)).to eq true
@@ -40,4 +34,4 @@ describe Pubnub::DeleteMessages do
40
34
  end
41
35
  end
42
36
  end
43
- end
37
+ end