wcc-data 0.3.2 → 0.3.3
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/lib/wcc/data/config.rb +1 -0
- data/lib/wcc/data/mapper.rb +1 -0
- data/lib/wcc/data/mapper/json_response.rb +1 -0
- data/lib/wcc/data/version.rb +1 -1
- data/spec/spec_helper.rb +2 -0
- data/spec/wcc/data/faraday_client_app_token_auth_spec.rb +13 -0
- data/spec/wcc/data/mapper/json_response_spec.rb +7 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9230bc1ee02de1bf143a3f9d758738a5e204b735
|
4
|
+
data.tar.gz: 725661d38a8aa43e6828646a57f5b75d8f34b7aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c79626edcd8f549520c59ae019a4218cbb50394a5b351d066ba0abefaa8f735694d9ecfbcebfcf393b7fb8b71aff8533d79d36ffbd195f8f5340541586653ccb
|
7
|
+
data.tar.gz: 7cb4da447fb750e8de2f0343800983ae20c0e2f8394940eda1f5aa027c1fa4bc5c930929dd19fc6ac65e84733df8b4b2acecf05f134f5017d2fb2c5e3d90c6be
|
data/lib/wcc/data/config.rb
CHANGED
@@ -15,6 +15,7 @@ module WCC::Data
|
|
15
15
|
private
|
16
16
|
|
17
17
|
def set_default_applications
|
18
|
+
raise ArgumentError, "Missing NUCLEUS_URL environment variable" unless ENV['NUCLEUS_URL']
|
18
19
|
applications[:nucleus].uri = ENV['NUCLEUS_URL']
|
19
20
|
if ENV['APP_CLIENT_ID'] && ENV['APP_CLIENT_SECRET']
|
20
21
|
applications[:nucleus].connection
|
data/lib/wcc/data/mapper.rb
CHANGED
data/lib/wcc/data/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -219,6 +219,19 @@ RSpec.describe WCC::Data::FaradayClientAppTokenAuth do
|
|
219
219
|
expect(cache).to receive(:[]=).with("example.com", "abc123")
|
220
220
|
auth.token_for("example.com")
|
221
221
|
end
|
222
|
+
|
223
|
+
it "passes error up the chain when service unavailable" do
|
224
|
+
allow(auth.token_factory)
|
225
|
+
.to receive(:call)
|
226
|
+
.and_raise(WCC::Data::Mapper::ServiceUnavailable)
|
227
|
+
|
228
|
+
expect {
|
229
|
+
auth.call({
|
230
|
+
url: URI("http://example.com"),
|
231
|
+
request_headers: {},
|
232
|
+
})
|
233
|
+
}.to raise_error(WCC::Data::Mapper::ServiceUnavailable)
|
234
|
+
end
|
222
235
|
end
|
223
236
|
end
|
224
237
|
end
|
@@ -41,6 +41,13 @@ describe WCC::Data::Mapper::JSONResponse do
|
|
41
41
|
|
42
42
|
end
|
43
43
|
|
44
|
+
it "raises ServiceUnavailable when response status is 503" do
|
45
|
+
allow(singular_response).to receive(:status).and_return(503)
|
46
|
+
expect { klass.new_from_response(singular_response) }
|
47
|
+
.to raise_error(WCC::Data::Mapper::ServiceUnavailable)
|
48
|
+
|
49
|
+
end
|
50
|
+
|
44
51
|
it "raises InvalidResponse error for non-json objects" do
|
45
52
|
expect { klass.new_from_response(double(json: 1, status: 200)) }
|
46
53
|
.to raise_error(WCC::Data::Mapper::InvalidResponse)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wcc-data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Watermark Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
173
|
version: '0'
|
174
174
|
requirements: []
|
175
175
|
rubyforge_project:
|
176
|
-
rubygems_version: 2.
|
176
|
+
rubygems_version: 2.5.2
|
177
177
|
signing_key:
|
178
178
|
specification_version: 4
|
179
179
|
summary: Watermark's library for interapp communication via APIs
|