onc_certification_g10_test_kit 6.0.1 → 6.0.2

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
  SHA256:
3
- metadata.gz: 57e30707252971322a92bc313ff1d95705aea89c475cc2a1f307328ecbc09337
4
- data.tar.gz: d3c87ac998c3369798d33125a1f71fb0b7fd10d032bf2aa6557b0a79786baf9f
3
+ metadata.gz: b5babf8413662a8280eac15f50f5cb634bfa2e2cdd637982c7dfb123817f2dfa
4
+ data.tar.gz: 36f285e6677cfd7114695620898d0bfe1cc304325dae63055f5fc12ade27b4b6
5
5
  SHA512:
6
- metadata.gz: bf3740b53d586ac040f415f33575cee9d3a4391531f2b921f020de599931937e4dc55776c108e95be872df48831c32b8f256c15773d7105a64756ff11033ff9a
7
- data.tar.gz: 24e3d183e40bcbdac46e6cc497788f014b42b432bf0589231fc6b3996c3c6ca87a621f224b9cb446196ff3e94a09d3eddfda2aaf6913f24223a5b9038a47b853
6
+ metadata.gz: ed759baf8f19a6c2ad5afe841219c087d17c363efa3fbdb1385e214cf350d1a4d4ef886eaccb4586d960540b1f8125ae0065aeeb05318dd6bc7d3af5542ee734
7
+ data.tar.gz: f0c151db9d23d5b89a8f48d5f7953d6ca568f79e1f36b7e86f2a5f041b6e7f3abcf12731b5fd1363e70b0c6a83d59f1b50f2b7a46e714b3c982fa3a751df858a
@@ -16,14 +16,40 @@ module ONCCertificationG10TestKit
16
16
  id :g10_patient_scope
17
17
  input :received_scopes
18
18
 
19
+ def scope_version
20
+ config.options[:scope_version]
21
+ end
22
+
19
23
  run do
20
- expected_scope = if config.options[:scope_version] == :v2
21
- 'patient/Patient.rs'
22
- else
23
- 'patient/Patient.read'
24
- end
25
- assert received_scopes&.include?(expected_scope),
26
- "#{expected_scope} scope was requested, but not received. Received: `#{received_scopes}`"
24
+ expected_scopes =
25
+ if scope_version == :v2
26
+ [
27
+ Regexp.new(scope_regex_string('patient/Patient.rs').gsub('.rs', '.r?s')),
28
+ Regexp.new(scope_regex_string('patient/Patient.rs').gsub('.rs', '.rs?'))
29
+ ]
30
+ else
31
+ [Regexp.new(scope_regex_string('patient/Patient.read'))]
32
+ end
33
+
34
+ received_scopes = self.received_scopes.split
35
+
36
+ unmatched_scopes =
37
+ expected_scopes.reject do |expected_scope|
38
+ received_scopes.any? { |received_scope| received_scope.match? expected_scope }
39
+ end
40
+
41
+ assert unmatched_scopes.blank?,
42
+ "No scope matching the following was received: `#{unmatched_scopes_string(unmatched_scopes)}`"
43
+ end
44
+
45
+ def scope_regex_string(scope)
46
+ "\\A#{Regexp.quote(scope)}\\z"
47
+ end
48
+
49
+ def unmatched_scopes_string(unmatched_scopes)
50
+ unmatched_scopes
51
+ .map { |scope| "`#{scope.source}`" }
52
+ .join(', ')
27
53
  end
28
54
  end
29
55
  end
@@ -1,3 +1,3 @@
1
1
  module ONCCertificationG10TestKit
2
- VERSION = '6.0.1'.freeze
2
+ VERSION = '6.0.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onc_certification_g10_test_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.1
4
+ version: 6.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen MacVicar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-28 00:00:00.000000000 Z
11
+ date: 2024-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bloomer
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - '='
144
144
  - !ruby/object:Gem::Version
145
- version: 0.8.0
145
+ version: 0.8.1
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - '='
151
151
  - !ruby/object:Gem::Version
152
- version: 0.8.0
152
+ version: 0.8.1
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: database_cleaner-sequel
155
155
  requirement: !ruby/object:Gem::Requirement