mercurius 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mercurius/testing/result.rb +28 -0
- data/lib/mercurius/testing/service.rb +1 -0
- data/lib/mercurius/testing.rb +1 -0
- data/lib/mercurius/version.rb +1 -1
- data/spec/lib/testing_spec.rb +7 -5
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fff5a024bedc9602172b080681a4ed8b28f8d45
|
4
|
+
data.tar.gz: 06d8f0cd9206fc23c70cf66e48c2c1912bd3458e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66e282ada6fef6296cf21380105f067aae9a54c27e0f0058f28b1fe467fc6595531c1aa7eef4d16017fb675ed4ef276522752436d557ef2fae0a206c40b6abb7
|
7
|
+
data.tar.gz: 8caff3a87dd456736a0777607998f75a5e8b3a3dd1ef7cc2b280b776b05ac2c3bf05b4de8496050d42aefa7ebe8a2165e6ca3f8070ae4bc673ffc3228de54ede
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Mercurius
|
2
|
+
module Testing
|
3
|
+
class Result
|
4
|
+
attr_reader :responses
|
5
|
+
|
6
|
+
def initialize(notification)
|
7
|
+
@notification = notification
|
8
|
+
@responses = []
|
9
|
+
end
|
10
|
+
|
11
|
+
def success?
|
12
|
+
true
|
13
|
+
end
|
14
|
+
|
15
|
+
def process_response(*)
|
16
|
+
end
|
17
|
+
|
18
|
+
def failed_responses
|
19
|
+
[]
|
20
|
+
end
|
21
|
+
|
22
|
+
def failed_device_tokens
|
23
|
+
[]
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/mercurius/testing.rb
CHANGED
data/lib/mercurius/version.rb
CHANGED
data/spec/lib/testing_spec.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
|
2
|
-
require File.expand_path(
|
3
|
-
|
1
|
+
%w(service base result delivery).each do |rb|
|
2
|
+
require File.expand_path("../../../lib/mercurius/testing/#{rb}", __FILE__)
|
3
|
+
end
|
4
4
|
|
5
5
|
describe 'Test mode' do
|
6
6
|
|
@@ -21,10 +21,11 @@ describe 'Test mode' do
|
|
21
21
|
let(:message) { GCM::Notification.new(alert: 'Hey') }
|
22
22
|
|
23
23
|
it 'returns the deliveries sent to GCM' do
|
24
|
-
service.deliver message, 'token123'
|
24
|
+
result = service.deliver message, 'token123'
|
25
25
|
delivery = Mercurius::Testing::Base.deliveries[0]
|
26
26
|
expect(delivery.device_tokens).to include 'token123'
|
27
27
|
expect(delivery.notification.data).to eq Hash[alert: 'Hey']
|
28
|
+
expect(result).to be_a_kind_of Mercurius::Testing::Result
|
28
29
|
end
|
29
30
|
end
|
30
31
|
|
@@ -33,10 +34,11 @@ describe 'Test mode' do
|
|
33
34
|
let(:message) { APNS::Notification.new(alert: 'Hey') }
|
34
35
|
|
35
36
|
it 'returns the deliveries sent to APNS' do
|
36
|
-
service.deliver message, 'token123'
|
37
|
+
result = service.deliver message, 'token123'
|
37
38
|
delivery = Mercurius::Testing::Base.deliveries[0]
|
38
39
|
expect(delivery.device_tokens).to include 'token123'
|
39
40
|
expect(delivery.notification.alert).to eq 'Hey'
|
41
|
+
expect(result).to be_a_kind_of Mercurius::Testing::Result
|
40
42
|
end
|
41
43
|
end
|
42
44
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mercurius
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Beck
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -157,6 +157,7 @@ files:
|
|
157
157
|
- lib/mercurius/testing.rb
|
158
158
|
- lib/mercurius/testing/base.rb
|
159
159
|
- lib/mercurius/testing/delivery.rb
|
160
|
+
- lib/mercurius/testing/result.rb
|
160
161
|
- lib/mercurius/testing/service.rb
|
161
162
|
- lib/mercurius/version.rb
|
162
163
|
- mercurius.gemspec
|