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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: abe2a3460e88fbddb7d47cb2a8c8376cc7ca8b35
4
- data.tar.gz: b7b6732d28fc1a0243a167a479c67e2b00791853
3
+ metadata.gz: 07b9615104913124d488adcfe8dcd8fc2b7d8a39
4
+ data.tar.gz: e28bb319e0a7cb541000cc3426abc14f62c1f5cf
5
5
  SHA512:
6
- metadata.gz: 910aaa5a1fa67d2e27628ff59023d0f07bc75d527ae7740a4797c8901c6f5e5bd2402ca0aa26e77048e7b36dd319270b781ed320affbe064379369616790f09e
7
- data.tar.gz: ffb940fbcf3a9151e27e33871d720ee09adae059aff393a72b9859ef76ea8e91299be2ff3a93b67d6388f401cef050125da89ab2cc5e6eed68c748cae8d55b8b
6
+ metadata.gz: 2c9c06247100c245101a39333e520f52d64e0be29ad1302c5fe263f7c6851107ccf9256abb07282e9ccb314cec7c2f3e16247122ef890fc35b58843ab9c5bc85
7
+ data.tar.gz: 2b7deda3ee98b10f332c19a0379232c76e46a7ebd2f55994cfe76453270d259302eddd6a2d3287d1f3b87a939867ee04bd7af2e3f4a7382bf88abc4ed8889158
data/.rubocop.yml CHANGED
@@ -29,8 +29,3 @@ FinalNewline:
29
29
 
30
30
  SignalException:
31
31
  Enabled: False
32
-
33
- # Gems typically have one file named the-gem-name.rb which can be autorequired by bundler
34
- FileName:
35
- Exclude:
36
- - lib/roqua-healthy.rb
data/ChangeLog.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 1.1.4
2
+
3
+ * Better handling for 403 and 404 responses.
4
+
5
+ ### 1.1.3
6
+
7
+ * No idea. Someone forgot to update changelog
8
+
1
9
  ### 1.1.2
2
10
 
3
11
  * Fall back to PID.13.1 for cell_phone when type is undefined
@@ -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
@@ -11,6 +11,7 @@ module Roqua
11
11
  class UnknownFailure < Error; end
12
12
  class PatientIdNotInRemote < Error; end
13
13
  class PatientNotFound < Error; end
14
+ class AuthenticationFailure < Error; end
14
15
 
15
16
  module MirthErrors
16
17
  class WrongPatient < Error; end
@@ -1,6 +1,6 @@
1
1
  module Roqua
2
2
  module Healthy
3
3
  # healthy version
4
- VERSION = "1.1.3"
4
+ VERSION = "1.1.4"
5
5
  end
6
6
  end
@@ -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', '~> 0.17'
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
- end
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.3
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-04-07 00:00:00.000000000 Z
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: '0.17'
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: '0.17'
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.1
325
+ rubygems_version: 2.2.2
326
326
  signing_key:
327
327
  specification_version: 4
328
328
  summary: Arranges communication between Mirth and RoQua