turbot-runner 0.1.27 → 0.1.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/turbot_runner/validator.rb +1 -20
- data/lib/turbot_runner/version.rb +1 -1
- data/spec/spec_helper.rb +6 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjYzZDlmY2UyY2RkYWQ0MzI5YTAxNjVmNGM4NWJlZWM5MWNmNGZjMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGQyN2QwNjI5YTI2YzdiOTBhMzIxOWJiODdmZjhlM2NlNGEzYjBkNg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MzFjNjk5MWNhM2JjNjFlOTEyNzE2M2ZjZjdkOTBiY2VhMDM1ZjYyYTgzYzRl
|
10
|
+
ZjkwODM3MjBmNmUxMjM3YWE1ZGM2ZGYyNTFmOGM5N2NjMjJjMmI4YmIyOWFi
|
11
|
+
ZmE1NGJjNjM3Yzc3MGQ4YjViODVkYzFiZWJjYWIxYjk4ZmViMmU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTYxZjYyZWIzZWQ3YmY0M2I3MDViZmY5MGE2Y2JkNzVkYWE3ZjQwMDIwYmUw
|
14
|
+
OWI1YmZmZmI3YjhhM2I2NzhkZjNmM2IzZTQ4MTNjNDliMDM1YTQzMzcwODgx
|
15
|
+
ODdjYWU3YjljZGMwODk1YjFkZDY3OTVmZDM2NGQ3NzNiYzM1Yjg=
|
@@ -19,26 +19,7 @@ module TurbotRunner
|
|
19
19
|
message = "There were no values provided for any of the identifying fields: #{identifying_fields.join(', ')}"
|
20
20
|
end
|
21
21
|
else
|
22
|
-
message =
|
23
|
-
when :missing
|
24
|
-
"Missing required property: #{error[:path]}"
|
25
|
-
when :one_of_no_matches
|
26
|
-
"No match for property: #{error[:path]}"
|
27
|
-
when :one_of_many_matches
|
28
|
-
"Multiple possible matches for property: #{error[:path]}"
|
29
|
-
when :too_short
|
30
|
-
"Property too short: #{error[:path]} (must be at least #{error[:length]} characters)"
|
31
|
-
when :too_long
|
32
|
-
"Property too long: #{error[:path]} (must be at most #{error[:length]} characters)"
|
33
|
-
when :type_mismatch
|
34
|
-
"Property of wrong type: #{error[:path]} (must be of type #{error[:allowed_types].join(', ')})"
|
35
|
-
when :enum_mismatch
|
36
|
-
"Property not an allowed value: #{error[:path]} (must be one of #{error[:allowed_values].join(', ')})"
|
37
|
-
when :format_mismatch
|
38
|
-
"Property not of expected format: #{error[:path]} (must be of format #{error[:expected_format]})"
|
39
|
-
when :unknown
|
40
|
-
error[:message]
|
41
|
-
end
|
22
|
+
message = error[:message]
|
42
23
|
end
|
43
24
|
|
44
25
|
message
|
data/spec/spec_helper.rb
CHANGED
@@ -3,7 +3,12 @@ require 'turbot_runner'
|
|
3
3
|
RSpec::Matchers.define(:fail_validation_with) do |expected_error|
|
4
4
|
match do |record|
|
5
5
|
identifying_fields = ['number']
|
6
|
-
|
6
|
+
@error = TurbotRunner::Validator.validate('primary-data', record, identifying_fields)
|
7
|
+
expect(@error).to eq(expected_error)
|
8
|
+
end
|
9
|
+
|
10
|
+
failure_message do |actual|
|
11
|
+
"Expected error to be #{expected_error}, but was #{@error}"
|
7
12
|
end
|
8
13
|
end
|
9
14
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turbot-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.28
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenCorporates
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: openc-json_schema
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.0.
|
19
|
+
version: 0.0.8
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.0.
|
26
|
+
version: 0.0.8
|
27
27
|
description:
|
28
28
|
email: bots@opencorporates.com
|
29
29
|
executables: []
|