passfort 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +4 -4
- data/lib/passfort/errors.rb +1 -0
- data/lib/passfort/errors/timeout_error.rb +12 -0
- data/lib/passfort/http.rb +4 -0
- data/lib/passfort/version.rb +1 -1
- data/spec/passfort/http_spec.rb +8 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5832d8b7e35914667cd070932413409c72ba907a9a0f66c4f371a38ad830dfe5
|
4
|
+
data.tar.gz: 5a78b3c88b98268f33eac8d6992b170338334f80397145ad895a21d35d0ff042
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad1b56c1c2b447e2f43d307477677892e0c711974611b023d88c089c7e4d27bf5e468750c930173d4d7e1bb8b32a4a85763bb34923a3358277cb1f6fa9f1e87f
|
7
|
+
data.tar.gz: 301c2f12b9e4d148604d3b90d8642f7a05f17979641a9d9837f97e9dfb50bcce98776342e2f15924f14b8b54046d35905854644629d3d587ddb122d2f9735ea6
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
passfort (0.2.
|
4
|
+
passfort (0.2.3)
|
5
5
|
activesupport (~> 5.0)
|
6
6
|
excon (~> 0.60)
|
7
7
|
|
@@ -21,7 +21,7 @@ GEM
|
|
21
21
|
crack (0.4.3)
|
22
22
|
safe_yaml (~> 1.0.0)
|
23
23
|
diff-lcs (1.3)
|
24
|
-
excon (0.
|
24
|
+
excon (0.62.0)
|
25
25
|
gc_ruboconfig (2.3.5)
|
26
26
|
rubocop (~> 0.54.0)
|
27
27
|
rubocop-rspec (~> 1.24)
|
@@ -31,13 +31,13 @@ GEM
|
|
31
31
|
method_source (0.9.0)
|
32
32
|
minitest (5.11.3)
|
33
33
|
parallel (1.12.1)
|
34
|
-
parser (2.5.0.
|
34
|
+
parser (2.5.0.5)
|
35
35
|
ast (~> 2.4.0)
|
36
36
|
powerpack (0.1.1)
|
37
37
|
pry (0.11.3)
|
38
38
|
coderay (~> 1.1.0)
|
39
39
|
method_source (~> 0.9.0)
|
40
|
-
public_suffix (3.0.
|
40
|
+
public_suffix (3.0.2)
|
41
41
|
rainbow (3.0.0)
|
42
42
|
rspec (3.7.0)
|
43
43
|
rspec-core (~> 3.7.0)
|
data/lib/passfort/errors.rb
CHANGED
@@ -7,6 +7,7 @@ require "passfort/errors/invalid_api_key_error"
|
|
7
7
|
require "passfort/errors/invalid_input_data_error"
|
8
8
|
require "passfort/errors/request_error"
|
9
9
|
require "passfort/errors/unparseable_response_error"
|
10
|
+
require "passfort/errors/timeout_error"
|
10
11
|
|
11
12
|
module Passfort
|
12
13
|
module Errors
|
data/lib/passfort/http.rb
CHANGED
@@ -20,6 +20,8 @@ module Passfort
|
|
20
20
|
body
|
21
21
|
rescue JSON::ParserError
|
22
22
|
raise Passfort::Errors::UnparseableResponseError.new([], response)
|
23
|
+
rescue Excon::Errors::Timeout
|
24
|
+
raise Passfort::Errors::TimeoutError
|
23
25
|
end
|
24
26
|
|
25
27
|
def post(path, body:)
|
@@ -33,6 +35,8 @@ module Passfort
|
|
33
35
|
body
|
34
36
|
rescue JSON::ParserError
|
35
37
|
raise Passfort::Errors::UnparseableResponseError.new([], response)
|
38
|
+
rescue Excon::Errors::Timeout
|
39
|
+
raise Passfort::Errors::TimeoutError
|
36
40
|
end
|
37
41
|
|
38
42
|
private
|
data/lib/passfort/version.rb
CHANGED
data/spec/passfort/http_spec.rb
CHANGED
@@ -12,7 +12,7 @@ RSpec.describe Passfort::Http do
|
|
12
12
|
let(:error_code) { 0 }
|
13
13
|
let(:body) { { errors: { code: error_code } }.to_json }
|
14
14
|
|
15
|
-
before { stub_request(method, api_path).
|
15
|
+
before { stub_request(method, api_path).to_return(status: status, body: body) }
|
16
16
|
|
17
17
|
context "when returning a request error" do
|
18
18
|
let(:status) { 404 }
|
@@ -68,6 +68,13 @@ RSpec.describe Passfort::Http do
|
|
68
68
|
expect(result).to include("id" => "6c1d594a-496e-11e7-911e-acbc32b67d7b")
|
69
69
|
end
|
70
70
|
end
|
71
|
+
|
72
|
+
context "when the request times out" do
|
73
|
+
before { stub_request(method, api_path).to_raise(Excon::Errors::Timeout) }
|
74
|
+
let(:error_class) { Passfort::Errors::TimeoutError }
|
75
|
+
|
76
|
+
it { is_expected.to raise_error(error_class) }
|
77
|
+
end
|
71
78
|
end
|
72
79
|
|
73
80
|
describe "#get" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: passfort
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GoCardless
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- lib/passfort/errors/invalid_api_key_error.rb
|
136
136
|
- lib/passfort/errors/invalid_input_data_error.rb
|
137
137
|
- lib/passfort/errors/request_error.rb
|
138
|
+
- lib/passfort/errors/timeout_error.rb
|
138
139
|
- lib/passfort/errors/unknown_api_error.rb
|
139
140
|
- lib/passfort/errors/unparseable_response_error.rb
|
140
141
|
- lib/passfort/http.rb
|