grocer 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.3.3
4
+
5
+ * Notifications that only include a custom payload are now valid. ([overlycommonname](https://github.com/overlycommonname))
6
+
3
7
  ## 0.3.2
4
8
 
5
9
  * Validate the size of the payload before sending a notification
@@ -47,7 +47,7 @@ module Grocer
47
47
  end
48
48
 
49
49
  def validate_payload
50
- fail NoPayloadError unless alert || badge
50
+ fail NoPayloadError unless alert || badge || custom
51
51
  fail PayloadTooLargeError if payload_too_large?
52
52
  end
53
53
 
@@ -1,3 +1,3 @@
1
1
  module Grocer
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.3'
3
3
  end
@@ -49,9 +49,19 @@ describe Grocer::Notification do
49
49
  context 'missing payload' do
50
50
  let(:payload_options) { Hash.new }
51
51
 
52
- it 'raises an error when neither alert nor badge is specified' do
52
+ it 'raises an error when none of alert, badge, or custom are specified' do
53
53
  -> { notification.to_bytes }.should raise_error(Grocer::NoPayloadError)
54
54
  end
55
+
56
+ [{alert: 'hi'}, {badge: 1}, {custom: {a: 'b'}}].each do |payload|
57
+ context "when #{payload.keys.first} exists, but not any other payload keys" do
58
+ let(:payload_options) { payload }
59
+
60
+ it 'does not raise an error' do
61
+ -> { notification.to_bytes }.should_not raise_error
62
+ end
63
+ end
64
+ end
55
65
  end
56
66
 
57
67
  context 'oversized payload' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grocer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-02-28 00:00:00.000000000 Z
14
+ date: 2013-03-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rspec
@@ -170,7 +170,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
170
170
  version: '0'
171
171
  segments:
172
172
  - 0
173
- hash: -399715243168588084
173
+ hash: 215139925189749573
174
174
  required_rubygems_version: !ruby/object:Gem::Requirement
175
175
  none: false
176
176
  requirements:
@@ -179,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
179
  version: '0'
180
180
  segments:
181
181
  - 0
182
- hash: -399715243168588084
182
+ hash: 215139925189749573
183
183
  requirements: []
184
184
  rubyforge_project:
185
185
  rubygems_version: 1.8.23