ably 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f84e069f72578aa8f1dd02fb6925da8a03cb702a
4
- data.tar.gz: 0d96682769ebf4ed7b9d0d9fc84603e2a99101fe
3
+ metadata.gz: ec00d1068f71b56bbd617d688762b9736c3dc905
4
+ data.tar.gz: 43c524b37e87cd8d5b028b3e21211a8d175096d5
5
5
  SHA512:
6
- metadata.gz: 139bc0db9fc45e8814c352d8e046666eebb3123c46898256ca3f6c47cf9d66ad86d2dbf76a63ffbf3fdaad0b0f23c3b46c4062e4b5811892481295748826510b
7
- data.tar.gz: e4f947a9eb775db94fb413522b935120b5f3ee9d4b6df965ba1c82c676034d5fe653e1120a52c45ae45713c522bed5d582b79cc24e541f69e857cab0c8874284
6
+ metadata.gz: 54e6043bc398bf76397bab60b9c9922824c79c96223421cfb0496ce70ef83339300a799d3fe4cf2b440c1834ca5ecda634c060f63a769f237674051bc7e4120e
7
+ data.tar.gz: 1377c7533da5ccc4996237c9b345ede359548e5ae1845f50f1c590e2d4b6759bd7f3fa194911404158b8935c5fa76b36757e5d6b57007b8d2bea9b858c3c5c0c
@@ -39,7 +39,7 @@ module Ably
39
39
  message.join(' ')
40
40
  end
41
41
 
42
- def as_json
42
+ def as_json(*args)
43
43
  {
44
44
  message: "#{self.class}: #{message}",
45
45
  status: @status,
@@ -26,7 +26,7 @@ module Ably::Modules
26
26
 
27
27
  # Return a JSON ready object from the underlying #attributes using Ably naming conventions for keys
28
28
  # @return [Hash]
29
- def as_json
29
+ def as_json(*args)
30
30
  attributes.as_json.reject { |key, val| val.nil? }
31
31
  end
32
32
 
@@ -1,5 +1,5 @@
1
1
  module Ably
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  PROTOCOL_VERSION = '1.0'
4
4
 
5
5
  # Allow a variant to be configured for all instances of this client library
@@ -76,6 +76,8 @@ describe 'Ably::Realtime::Channel Message', :event_machine do
76
76
  end
77
77
 
78
78
  context 'with supported extra payload content type (#RTL6h, #RSL6a2)' do
79
+ let(:channel) { client.channel("pushenabled:#{random_str}") }
80
+
79
81
  def publish_and_check_extras(extras)
80
82
  channel.attach
81
83
  channel.publish 'event', {}, extras: extras
@@ -86,7 +88,7 @@ describe 'Ably::Realtime::Channel Message', :event_machine do
86
88
  end
87
89
 
88
90
  context 'JSON Object (Hash)' do
89
- let(:data) { { 'push' => { 'title' => 'Testing' } } }
91
+ let(:data) { { 'push' => { 'notification' => { 'title' => 'Testing' } } } }
90
92
 
91
93
  it 'is encoded and decoded to the same hash' do
92
94
  publish_and_check_extras data
@@ -94,7 +96,8 @@ describe 'Ably::Realtime::Channel Message', :event_machine do
94
96
  end
95
97
 
96
98
  context 'JSON Array' do
97
- let(:data) { { 'push' => [ nil, true, false, 55, 'string', { 'Hash' => true }, ['array'] ] } }
99
+ # TODO: Add nil type back in
100
+ let(:data) { { 'push' => { 'data' => { 'key' => [ true, false, 55, 'string', { 'Hash' => true }, ['array'] ] } } } }
98
101
 
99
102
  it 'is encoded and decoded to the same Array' do
100
103
  publish_and_check_extras data
@@ -62,8 +62,10 @@ describe Ably::Rest::Channel, 'messages' do
62
62
  end
63
63
 
64
64
  context 'with supported extra payload content type (#RSL1h, #RSL6a2)' do
65
+ let(:channel) { client.channel("pushenabled:#{random_str}") }
66
+
65
67
  context 'JSON Object (Hash)' do
66
- let(:data) { { 'push' => { 'title' => 'Testing' } } }
68
+ let(:data) { { 'push' => { 'notification' => { 'title' => 'Testing' } } } }
67
69
 
68
70
  it 'is encoded and decoded to the same hash' do
69
71
  channel.publish 'event', {}, extras: data
@@ -72,9 +74,10 @@ describe Ably::Rest::Channel, 'messages' do
72
74
  end
73
75
 
74
76
  context 'JSON Array' do
75
- let(:data) { { 'push' => [ nil, true, false, 55, 'string', { 'Hash' => true }, ['array'] ] } }
77
+ # TODO: Add nil type back in
78
+ let(:data) { { 'push' => { 'data' => { 'key' => [ true, false, 55, 'string', { 'Hash' => true }, ['array'] ] } } } }
76
79
 
77
- it 'is encoded and decoded to the same Array' do
80
+ it 'is encoded and decoded to the same deep multi-type object' do
78
81
  channel.publish 'event', {}, extras: data
79
82
  expect(channel.history.items.first.extras).to eql(data)
80
83
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ably
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lewis Marshall
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-05-16 00:00:00.000000000 Z
12
+ date: 2017-05-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine
@@ -458,7 +458,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
458
458
  version: '0'
459
459
  requirements: []
460
460
  rubyforge_project:
461
- rubygems_version: 2.6.8
461
+ rubygems_version: 2.4.8
462
462
  signing_key:
463
463
  specification_version: 4
464
464
  summary: A Ruby client library for ably.io realtime messaging implemented using EventMachine