roqua-healthy 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +0 -5
- data/ChangeLog.md +8 -0
- data/lib/roqua/healthy/a19/response_validator.rb +13 -1
- data/lib/roqua/healthy/errors.rb +1 -0
- data/lib/roqua/healthy/version.rb +1 -1
- data/roqua-healthy.gemspec +1 -1
- data/spec/integration/medo_spec.rb +17 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07b9615104913124d488adcfe8dcd8fc2b7d8a39
|
4
|
+
data.tar.gz: e28bb319e0a7cb541000cc3426abc14f62c1f5cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c9c06247100c245101a39333e520f52d64e0be29ad1302c5fe263f7c6851107ccf9256abb07282e9ccb314cec7c2f3e16247122ef890fc35b58843ab9c5bc85
|
7
|
+
data.tar.gz: 2b7deda3ee98b10f332c19a0379232c76e46a7ebd2f55994cfe76453270d259302eddd6a2d3287d1f3b87a939867ee04bd7af2e3f4a7382bf88abc4ed8889158
|
data/.rubocop.yml
CHANGED
data/ChangeLog.md
CHANGED
@@ -18,6 +18,10 @@ module Roqua
|
|
18
18
|
case response_code
|
19
19
|
when '200'
|
20
20
|
validate_200
|
21
|
+
when '403'
|
22
|
+
validate_403
|
23
|
+
when '404'
|
24
|
+
validate_404
|
21
25
|
when '500'
|
22
26
|
validate_500
|
23
27
|
else
|
@@ -32,6 +36,14 @@ module Roqua
|
|
32
36
|
true
|
33
37
|
end
|
34
38
|
|
39
|
+
def validate_403
|
40
|
+
raise ::Roqua::Healthy::AuthenticationFailure
|
41
|
+
end
|
42
|
+
|
43
|
+
def validate_404
|
44
|
+
raise ::Roqua::Healthy::PatientNotFound
|
45
|
+
end
|
46
|
+
|
35
47
|
def validate_500
|
36
48
|
failure = parser.fetch("failure")
|
37
49
|
raise ::Roqua::Healthy::Timeout, failure["error"] if failure["error"] == "Timeout waiting for ACK"
|
@@ -42,4 +54,4 @@ module Roqua
|
|
42
54
|
end
|
43
55
|
end
|
44
56
|
end
|
45
|
-
end
|
57
|
+
end
|
data/lib/roqua/healthy/errors.rb
CHANGED
data/roqua-healthy.gemspec
CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |gem|
|
|
34
34
|
gem.add_development_dependency 'guard-rspec', '~> 4.2.4'
|
35
35
|
gem.add_development_dependency 'listen', '~> 2.1'
|
36
36
|
gem.add_development_dependency 'guard-rubocop', '~> 1.0.1'
|
37
|
-
gem.add_development_dependency 'rubocop', '
|
37
|
+
gem.add_development_dependency 'rubocop', '= 0.17.0'
|
38
38
|
gem.add_development_dependency 'fuubar'
|
39
39
|
|
40
40
|
# Documentation generation
|
@@ -23,4 +23,20 @@ describe 'Fetching A19 from Medo' do
|
|
23
23
|
it { expect(subject[:gender]).to eq('M') }
|
24
24
|
it { expect(subject[:phone_cell]).to eq('0698765432') }
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
|
+
describe 'authentication failure' do
|
28
|
+
before { stub_mirth_response '', 403, '12345678901' }
|
29
|
+
|
30
|
+
it 'raises AuthenticationFailure' do
|
31
|
+
expect { Roqua::Healthy::A19.fetch("12345678901") }.to raise_error(Roqua::Healthy::AuthenticationFailure)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe 'a patient that does not exist' do
|
36
|
+
before { stub_mirth_response '', 404, '12345678901' }
|
37
|
+
|
38
|
+
it 'raises PatientNotFound' do
|
39
|
+
expect { Roqua::Healthy::A19.fetch("12345678901") }.to raise_error(Roqua::Healthy::PatientNotFound)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roqua-healthy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marten Veldthuis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -188,16 +188,16 @@ dependencies:
|
|
188
188
|
name: rubocop
|
189
189
|
requirement: !ruby/object:Gem::Requirement
|
190
190
|
requirements:
|
191
|
-
- -
|
191
|
+
- - '='
|
192
192
|
- !ruby/object:Gem::Version
|
193
|
-
version:
|
193
|
+
version: 0.17.0
|
194
194
|
type: :development
|
195
195
|
prerelease: false
|
196
196
|
version_requirements: !ruby/object:Gem::Requirement
|
197
197
|
requirements:
|
198
|
-
- -
|
198
|
+
- - '='
|
199
199
|
- !ruby/object:Gem::Version
|
200
|
-
version:
|
200
|
+
version: 0.17.0
|
201
201
|
- !ruby/object:Gem::Dependency
|
202
202
|
name: fuubar
|
203
203
|
requirement: !ruby/object:Gem::Requirement
|
@@ -322,7 +322,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
322
322
|
version: '0'
|
323
323
|
requirements: []
|
324
324
|
rubyforge_project:
|
325
|
-
rubygems_version: 2.2.
|
325
|
+
rubygems_version: 2.2.2
|
326
326
|
signing_key:
|
327
327
|
specification_version: 4
|
328
328
|
summary: Arranges communication between Mirth and RoQua
|