grocer 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/grocer/version.rb +1 -1
- data/spec/grocer/connection_spec.rb +16 -6
- metadata +13 -19
data/lib/grocer/version.rb
CHANGED
@@ -5,8 +5,7 @@ describe Grocer::Connection do
|
|
5
5
|
subject { described_class.new(connection_options) }
|
6
6
|
let(:connection_options) { { certificate: '/path/to/cert.pem',
|
7
7
|
gateway: 'push.example.com',
|
8
|
-
port: 443
|
9
|
-
retries: 3 } }
|
8
|
+
port: 443 } }
|
10
9
|
let(:ssl) { stub_everything('SSLConnection') }
|
11
10
|
before do
|
12
11
|
Grocer::SSLConnection.stubs(:new).returns(ssl)
|
@@ -30,6 +29,15 @@ describe Grocer::Connection do
|
|
30
29
|
subject.passphrase.should == 'new england clam chowder'
|
31
30
|
end
|
32
31
|
|
32
|
+
it 'defaults to 3 retries' do
|
33
|
+
subject.retries.should == 3
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'can be initialized with a number of retries' do
|
37
|
+
connection_options[:retries] = 2
|
38
|
+
subject.retries.should == 2
|
39
|
+
end
|
40
|
+
|
33
41
|
it 'requires a gateway' do
|
34
42
|
connection_options.delete(:gateway)
|
35
43
|
-> { described_class.new(connection_options) }.should raise_error(Grocer::NoGatewayError)
|
@@ -48,10 +56,6 @@ describe Grocer::Connection do
|
|
48
56
|
subject.port.should == 443
|
49
57
|
end
|
50
58
|
|
51
|
-
it 'can be initialized with a number of retries' do
|
52
|
-
subject.retries.should == 3
|
53
|
-
end
|
54
|
-
|
55
59
|
context 'an open SSLConnection' do
|
56
60
|
before do
|
57
61
|
ssl.stubs(:connected?).returns(true)
|
@@ -97,6 +101,12 @@ describe Grocer::Connection do
|
|
97
101
|
ssl.stubs(:write).raises(error).then.returns(42)
|
98
102
|
subject.write("abc123")
|
99
103
|
end
|
104
|
+
|
105
|
+
it 'raises the error if none of the retries work' do
|
106
|
+
connection_options[:retries] = 1
|
107
|
+
ssl.stubs(:read).raises(error).then.raises(error)
|
108
|
+
-> { subject.read }.should raise_error(error)
|
109
|
+
end
|
100
110
|
end
|
101
111
|
end
|
102
112
|
end
|
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.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,11 +11,11 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-04-
|
14
|
+
date: 2012-04-03 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rspec
|
18
|
-
requirement: &
|
18
|
+
requirement: &70130881884800 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ~>
|
@@ -23,10 +23,10 @@ dependencies:
|
|
23
23
|
version: 2.9.0
|
24
24
|
type: :development
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *70130881884800
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pry
|
29
|
-
requirement: &
|
29
|
+
requirement: &70130881884240 !ruby/object:Gem::Requirement
|
30
30
|
none: false
|
31
31
|
requirements:
|
32
32
|
- - ~>
|
@@ -34,10 +34,10 @@ dependencies:
|
|
34
34
|
version: 0.9.8
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
|
-
version_requirements: *
|
37
|
+
version_requirements: *70130881884240
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: mocha
|
40
|
-
requirement: &
|
40
|
+
requirement: &70130881880580 !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
43
|
- - ! '>='
|
@@ -45,10 +45,10 @@ dependencies:
|
|
45
45
|
version: '0'
|
46
46
|
type: :development
|
47
47
|
prerelease: false
|
48
|
-
version_requirements: *
|
48
|
+
version_requirements: *70130881880580
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: bourne
|
51
|
-
requirement: &
|
51
|
+
requirement: &70130881880060 !ruby/object:Gem::Requirement
|
52
52
|
none: false
|
53
53
|
requirements:
|
54
54
|
- - ! '>='
|
@@ -56,10 +56,10 @@ dependencies:
|
|
56
56
|
version: '0'
|
57
57
|
type: :development
|
58
58
|
prerelease: false
|
59
|
-
version_requirements: *
|
59
|
+
version_requirements: *70130881880060
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: rake
|
62
|
-
requirement: &
|
62
|
+
requirement: &70130881879360 !ruby/object:Gem::Requirement
|
63
63
|
none: false
|
64
64
|
requirements:
|
65
65
|
- - ! '>='
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
version: '0'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
|
-
version_requirements: *
|
70
|
+
version_requirements: *70130881879360
|
71
71
|
description: ! " Grocer interfaces with the Apple Push\n
|
72
72
|
\ Notification Service to send push\n notifications
|
73
73
|
to iOS devices and collect\n notification feedback via
|
@@ -130,21 +130,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
130
130
|
- - ! '>='
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: '0'
|
133
|
-
segments:
|
134
|
-
- 0
|
135
|
-
hash: 4223240216448352640
|
136
133
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
134
|
none: false
|
138
135
|
requirements:
|
139
136
|
- - ! '>='
|
140
137
|
- !ruby/object:Gem::Version
|
141
138
|
version: '0'
|
142
|
-
segments:
|
143
|
-
- 0
|
144
|
-
hash: 4223240216448352640
|
145
139
|
requirements: []
|
146
140
|
rubyforge_project:
|
147
|
-
rubygems_version: 1.8.
|
141
|
+
rubygems_version: 1.8.17
|
148
142
|
signing_key:
|
149
143
|
specification_version: 3
|
150
144
|
summary: Pushing Apple notifications since 2012.
|