px-service-client 2.0.5 → 2.0.6
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.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/lib/px/service/client/future.rb +4 -3
- data/lib/px/service/client/version.rb +1 -1
- data/px-service-client.gemspec +2 -2
- data/spec/px/service/client/future_spec.rb +23 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6dd6b2eca80f8716cdade8819b0108e113eb60e1
|
4
|
+
data.tar.gz: 295f01a5634dd62f02eefff91c3a2596ceb9c412
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91c9f30fc3415b1da55c1136a6782d9eca467148057d26d99d5674fd0ffd1f43389bd6a4af03cb87f34073204160ca2284b913df76e12f92c752137f050b8b73
|
7
|
+
data.tar.gz: 1a4e115b5c195750f99013b79f81420700e7d30ef537ba5e9755d131a3bbe2d5a8a4242c26b9b6a3cce9c0c10bda7a2048da84a38b33eedeb948c8be9a2a8752
|
data/.gitignore
CHANGED
data/px-service-client.gemspec
CHANGED
@@ -7,8 +7,8 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = "px-service-client"
|
8
8
|
spec.version = Px::Service::Client::VERSION
|
9
9
|
spec.summary = %q{Common service client behaviours for Ruby applications}
|
10
|
-
spec.authors = ["Chris Micacchi"]
|
11
|
-
spec.email = ["
|
10
|
+
spec.authors = ["Chris Micacchi", "Zimu Liu"]
|
11
|
+
spec.email = ["cdmicacc@gmail.com", "zimu@500px.com"]
|
12
12
|
spec.homepage = ""
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
@@ -226,4 +226,27 @@ describe Px::Service::Client::Future do
|
|
226
226
|
end
|
227
227
|
end
|
228
228
|
end
|
229
|
+
|
230
|
+
describe '#initialize' do
|
231
|
+
context 'when a block is given' do
|
232
|
+
context 'when the block returns a value' do
|
233
|
+
let(:value) { rand }
|
234
|
+
|
235
|
+
subject { Px::Service::Client::Future.new { value } }
|
236
|
+
|
237
|
+
it 'passes the value to the pending call' do
|
238
|
+
expect(subject.value).to eq(value)
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
context 'when the block throws an error' do
|
243
|
+
let(:error) { RuntimeError.new('error') }
|
244
|
+
subject { Px::Service::Client::Future.new { raise error } }
|
245
|
+
|
246
|
+
it 'passes the error to the pending call' do
|
247
|
+
expect(subject.value).to eq(error)
|
248
|
+
end
|
249
|
+
end
|
250
|
+
end
|
251
|
+
end
|
229
252
|
end
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: px-service-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Micacchi
|
8
|
+
- Zimu Liu
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2017-04-21 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: will_paginate
|
@@ -194,7 +195,8 @@ dependencies:
|
|
194
195
|
version: '0.5'
|
195
196
|
description:
|
196
197
|
email:
|
197
|
-
-
|
198
|
+
- cdmicacc@gmail.com
|
199
|
+
- zimu@500px.com
|
198
200
|
executables: []
|
199
201
|
extensions: []
|
200
202
|
extra_rdoc_files: []
|
@@ -259,7 +261,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
259
261
|
version: '0'
|
260
262
|
requirements: []
|
261
263
|
rubyforge_project:
|
262
|
-
rubygems_version: 2.
|
264
|
+
rubygems_version: 2.6.8
|
263
265
|
signing_key:
|
264
266
|
specification_version: 4
|
265
267
|
summary: Common service client behaviours for Ruby applications
|