adiwg-mdtranslator 1.0.0rc2 → 1.0.0rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/adiwg/mdtranslator/version.rb +1 -1
- metadata +1 -149
- data/test/schemas/v1_0/.gitignore +0 -18
- data/test/schemas/v1_0/.travis.yml +0 -7
- data/test/schemas/v1_0/CREDITS +0 -3
- data/test/schemas/v1_0/Gemfile +0 -4
- data/test/schemas/v1_0/LICENSE +0 -24
- data/test/schemas/v1_0/README.md +0 -36
- data/test/schemas/v1_0/Rakefile +0 -12
- data/test/schemas/v1_0/adiwg-json_schemas.gemspec +0 -25
- data/test/schemas/v1_0/examples/additionalDocumentation.json +0 -61
- data/test/schemas/v1_0/examples/address.json +0 -10
- data/test/schemas/v1_0/examples/associatedResource.json +0 -119
- data/test/schemas/v1_0/examples/citation.json +0 -128
- data/test/schemas/v1_0/examples/contact.json +0 -205
- data/test/schemas/v1_0/examples/contactRef.json +0 -12
- data/test/schemas/v1_0/examples/dataDictionary.json +0 -547
- data/test/schemas/v1_0/examples/dataQuality.json +0 -272
- data/test/schemas/v1_0/examples/date.json +0 -19
- data/test/schemas/v1_0/examples/distributor.json +0 -113
- data/test/schemas/v1_0/examples/extent_linestring.json +0 -288
- data/test/schemas/v1_0/examples/extent_point.json +0 -246
- data/test/schemas/v1_0/examples/extent_polygon.json +0 -353
- data/test/schemas/v1_0/examples/format.json +0 -14
- data/test/schemas/v1_0/examples/full_example.json +0 -2844
- data/test/schemas/v1_0/examples/full_example2.json +0 -2325
- data/test/schemas/v1_0/examples/geojson.json +0 -446
- data/test/schemas/v1_0/examples/graphicOverview.json +0 -28
- data/test/schemas/v1_0/examples/hierarchyLevel.json +0 -90
- data/test/schemas/v1_0/examples/keywords.json +0 -144
- data/test/schemas/v1_0/examples/lcc_project_example.json +0 -326
- data/test/schemas/v1_0/examples/legalConstraints.json +0 -17
- data/test/schemas/v1_0/examples/maintInfo.json +0 -34
- data/test/schemas/v1_0/examples/metadataInfo.json +0 -103
- data/test/schemas/v1_0/examples/minimum_example.json +0 -35
- data/test/schemas/v1_0/examples/onlineResource.json +0 -17
- data/test/schemas/v1_0/examples/resolution.json +0 -9
- data/test/schemas/v1_0/examples/resourceInfo.json +0 -1264
- data/test/schemas/v1_0/examples/resourceMaintenance.json +0 -10
- data/test/schemas/v1_0/examples/securityConstraints.json +0 -13
- data/test/schemas/v1_0/examples/spatialRef.json +0 -14
- data/test/schemas/v1_0/examples/taxonomy.json +0 -197
- data/test/schemas/v1_0/examples/temporalElement.json +0 -29
- data/test/schemas/v1_0/examples/uri.json +0 -16
- data/test/schemas/v1_0/examples/usage.json +0 -35
- data/test/schemas/v1_0/examples/verticalExtent.json +0 -18
- data/test/schemas/v1_0/lib/adiwg-mdjson_schemas.rb +0 -1
- data/test/schemas/v1_0/lib/adiwg/mdjson_schemas.rb +0 -7
- data/test/schemas/v1_0/lib/adiwg/mdjson_schemas/utils.rb +0 -20
- data/test/schemas/v1_0/lib/adiwg/mdjson_schemas/validator.rb +0 -42
- data/test/schemas/v1_0/lib/adiwg/mdjson_schemas/version.rb +0 -6
- data/test/schemas/v1_0/schema/schema.json +0 -64
- data/test/schemas/v1_0/schema/schema/citation.json +0 -186
- data/test/schemas/v1_0/schema/schema/contact.json +0 -255
- data/test/schemas/v1_0/schema/schema/dataDictionary.json +0 -209
- data/test/schemas/v1_0/schema/schema/dataQuality.json +0 -159
- data/test/schemas/v1_0/schema/schema/distributor.json +0 -171
- data/test/schemas/v1_0/schema/schema/extent.json +0 -214
- data/test/schemas/v1_0/schema/schema/geojson/bbox.json +0 -14
- data/test/schemas/v1_0/schema/schema/geojson/crs.json +0 -99
- data/test/schemas/v1_0/schema/schema/geojson/geojson.json +0 -194
- data/test/schemas/v1_0/schema/schema/geojson/geometry.json +0 -203
- data/test/schemas/v1_0/schema/schema/graphicOverview.json +0 -42
- data/test/schemas/v1_0/schema/schema/keyword.json +0 -39
- data/test/schemas/v1_0/schema/schema/maintInfo.json +0 -43
- data/test/schemas/v1_0/schema/schema/metadata.json +0 -173
- data/test/schemas/v1_0/schema/schema/onlineResource.json +0 -42
- data/test/schemas/v1_0/schema/schema/resolution.json +0 -51
- data/test/schemas/v1_0/schema/schema/resourceConstraint.json +0 -108
- data/test/schemas/v1_0/schema/schema/resourceInfo.json +0 -305
- data/test/schemas/v1_0/schema/schema/taxonomy.json +0 -122
- data/test/schemas/v1_0/schema/schema/usage.json +0 -39
- data/test/schemas/v1_0/templates/mdJson_template.json +0 -1065
- data/test/schemas/v1_0/test/draft-04.json +0 -189
- data/test/schemas/v1_0/test/tc_schemas.rb +0 -210
- data/test/schemas/v1_0/test/tc_utils.rb +0 -27
@@ -1,189 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"$schema" : "http://json-schema.org/draft-04/schema#",
|
3
|
-
"id" : "http://json-schema.org/draft-04/schema#",
|
4
|
-
"type" : "object",
|
5
|
-
|
6
|
-
"properties" : {
|
7
|
-
"type" : {
|
8
|
-
"type" : [
|
9
|
-
{
|
10
|
-
"id" : "#simple-type",
|
11
|
-
"type" : "string",
|
12
|
-
"enum" : ["object", "array", "string", "number", "boolean", "null", "any"]
|
13
|
-
},
|
14
|
-
"array"
|
15
|
-
],
|
16
|
-
"items" : {
|
17
|
-
"type" : [
|
18
|
-
{"$ref" : "#simple-type"},
|
19
|
-
{"$ref" : "#"}
|
20
|
-
]
|
21
|
-
},
|
22
|
-
"uniqueItems" : true,
|
23
|
-
"default" : "any"
|
24
|
-
},
|
25
|
-
|
26
|
-
"disallow" : {
|
27
|
-
"type" : ["string", "array"],
|
28
|
-
"items" : {
|
29
|
-
"type" : ["string", {"$ref" : "#"}]
|
30
|
-
},
|
31
|
-
"uniqueItems" : true
|
32
|
-
},
|
33
|
-
|
34
|
-
"extends" : {
|
35
|
-
"type" : [{"$ref" : "#"}, "array"],
|
36
|
-
"items" : {"$ref" : "#"},
|
37
|
-
"default" : {}
|
38
|
-
},
|
39
|
-
|
40
|
-
"enum" : {
|
41
|
-
"type" : "array",
|
42
|
-
"minItems" : 1,
|
43
|
-
"uniqueItems" : true
|
44
|
-
},
|
45
|
-
|
46
|
-
"minimum" : {
|
47
|
-
"type" : "number"
|
48
|
-
},
|
49
|
-
|
50
|
-
"maximum" : {
|
51
|
-
"type" : "number"
|
52
|
-
},
|
53
|
-
|
54
|
-
"exclusiveMinimum" : {
|
55
|
-
"type" : "boolean",
|
56
|
-
"default" : false
|
57
|
-
},
|
58
|
-
|
59
|
-
"exclusiveMaximum" : {
|
60
|
-
"type" : "boolean",
|
61
|
-
"default" : false
|
62
|
-
},
|
63
|
-
|
64
|
-
"divisibleBy" : {
|
65
|
-
"type" : "number",
|
66
|
-
"minimum" : 0,
|
67
|
-
"exclusiveMinimum" : true,
|
68
|
-
"default" : 1
|
69
|
-
},
|
70
|
-
|
71
|
-
"minLength" : {
|
72
|
-
"type" : "integer",
|
73
|
-
"minimum" : 0,
|
74
|
-
"default" : 0
|
75
|
-
},
|
76
|
-
|
77
|
-
"maxLength" : {
|
78
|
-
"type" : "integer"
|
79
|
-
},
|
80
|
-
|
81
|
-
"pattern" : {
|
82
|
-
"type" : "string"
|
83
|
-
},
|
84
|
-
|
85
|
-
"items" : {
|
86
|
-
"type" : [{"$ref" : "#"}, "array"],
|
87
|
-
"items" : {"$ref" : "#"},
|
88
|
-
"default" : {}
|
89
|
-
},
|
90
|
-
|
91
|
-
"additionalItems" : {
|
92
|
-
"type" : [{"$ref" : "#"}, "boolean"],
|
93
|
-
"default" : {}
|
94
|
-
},
|
95
|
-
|
96
|
-
"minItems" : {
|
97
|
-
"type" : "integer",
|
98
|
-
"minimum" : 0,
|
99
|
-
"default" : 0
|
100
|
-
},
|
101
|
-
|
102
|
-
"maxItems" : {
|
103
|
-
"type" : "integer",
|
104
|
-
"minimum" : 0
|
105
|
-
},
|
106
|
-
|
107
|
-
"uniqueItems" : {
|
108
|
-
"type" : "boolean",
|
109
|
-
"default" : false
|
110
|
-
},
|
111
|
-
|
112
|
-
"properties" : {
|
113
|
-
"type" : "object",
|
114
|
-
"additionalProperties" : {"$ref" : "#"},
|
115
|
-
"default" : {}
|
116
|
-
},
|
117
|
-
|
118
|
-
"patternProperties" : {
|
119
|
-
"type" : "object",
|
120
|
-
"additionalProperties" : {"$ref" : "#"},
|
121
|
-
"default" : {}
|
122
|
-
},
|
123
|
-
|
124
|
-
"additionalProperties" : {
|
125
|
-
"type" : [{"$ref" : "#"}, "boolean"],
|
126
|
-
"default" : {}
|
127
|
-
},
|
128
|
-
|
129
|
-
"minProperties" : {
|
130
|
-
"type" : "integer",
|
131
|
-
"minimum" : 0,
|
132
|
-
"default" : 0
|
133
|
-
},
|
134
|
-
|
135
|
-
"maxProperties" : {
|
136
|
-
"type" : "integer",
|
137
|
-
"minimum" : 0
|
138
|
-
},
|
139
|
-
|
140
|
-
"required" : {
|
141
|
-
"type" : "array",
|
142
|
-
"items" : {
|
143
|
-
"type" : "string"
|
144
|
-
}
|
145
|
-
},
|
146
|
-
|
147
|
-
"dependencies" : {
|
148
|
-
"type" : "object",
|
149
|
-
"additionalProperties" : {
|
150
|
-
"type" : ["string", "array", {"$ref" : "#"}],
|
151
|
-
"items" : {
|
152
|
-
"type" : "string"
|
153
|
-
}
|
154
|
-
},
|
155
|
-
"default" : {}
|
156
|
-
},
|
157
|
-
|
158
|
-
"id" : {
|
159
|
-
"type" : "string"
|
160
|
-
},
|
161
|
-
|
162
|
-
"$ref" : {
|
163
|
-
"type" : "string"
|
164
|
-
},
|
165
|
-
|
166
|
-
"$schema" : {
|
167
|
-
"type" : "string"
|
168
|
-
},
|
169
|
-
|
170
|
-
"title" : {
|
171
|
-
"type" : "string"
|
172
|
-
},
|
173
|
-
|
174
|
-
"description" : {
|
175
|
-
"type" : "string"
|
176
|
-
},
|
177
|
-
|
178
|
-
"default" : {
|
179
|
-
"type" : "any"
|
180
|
-
}
|
181
|
-
},
|
182
|
-
|
183
|
-
"dependencies" : {
|
184
|
-
"exclusiveMinimum" : "minimum",
|
185
|
-
"exclusiveMaximum" : "maximum"
|
186
|
-
},
|
187
|
-
|
188
|
-
"default" : {}
|
189
|
-
}
|
@@ -1,210 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
* Description: Test Validation of examples schemas and templates
|
3
|
-
* Author: Josh Bradley, Stan Smith
|
4
|
-
* Date: 2014-05-02
|
5
|
-
* License: Public Domain
|
6
|
-
=end
|
7
|
-
|
8
|
-
require 'minitest/autorun'
|
9
|
-
require 'json'
|
10
|
-
require 'json-schema'
|
11
|
-
require File.join(File.dirname(__FILE__),'..','lib', 'adiwg-mdjson_schemas.rb')
|
12
|
-
|
13
|
-
#json-schema patch
|
14
|
-
require File.join(File.dirname(__FILE__),'..','lib', 'adiwg', 'mdjson_schemas', 'validator.rb')
|
15
|
-
|
16
|
-
class TestExamples < Minitest::Test
|
17
|
-
|
18
|
-
@@dir = File.join(File.dirname(__FILE__),'..','schema/')
|
19
|
-
@@ex = File.join(File.dirname(__FILE__),'..','examples/')
|
20
|
-
@@schema = File.join(File.dirname(__FILE__),'..','schema','schema.json')
|
21
|
-
|
22
|
-
def test_schemas
|
23
|
-
#Validate the schemas themselves
|
24
|
-
#puts "\nValidating schemas, Please wait... \n"
|
25
|
-
schemas = `git ls-files #{@@dir}`.split($/)
|
26
|
-
errors = Array.new
|
27
|
-
|
28
|
-
schemas.each do |schema|
|
29
|
-
error = JSON::Validator.fully_validate(File.join(File.dirname(__FILE__), 'draft-04.json'), schema)
|
30
|
-
errors += error
|
31
|
-
end
|
32
|
-
|
33
|
-
assert(errors.empty?, errors.join("\n"))
|
34
|
-
end
|
35
|
-
|
36
|
-
def test_data_template
|
37
|
-
errors = JSON::Validator.fully_validate(@@schema, @@dir + '../templates/mdJson_template.json', :strict => false)
|
38
|
-
assert(errors.empty?, errors.join("\n"))
|
39
|
-
end
|
40
|
-
|
41
|
-
def test_full_example
|
42
|
-
errors = JSON::Validator.fully_validate(@@schema , @@ex + 'full_example.json')
|
43
|
-
assert(errors.empty?, errors.join("\n"))
|
44
|
-
end
|
45
|
-
|
46
|
-
def test_full_example2
|
47
|
-
errors = JSON::Validator.fully_validate(@@schema , @@ex + 'full_example2.json')
|
48
|
-
assert(errors.empty?, errors.join("\n"))
|
49
|
-
end
|
50
|
-
|
51
|
-
def test_minimum_example
|
52
|
-
errors = JSON::Validator.fully_validate(@@schema , @@ex + 'minimum_example.json')
|
53
|
-
assert(errors.empty?, errors.join("\n"))
|
54
|
-
end
|
55
|
-
|
56
|
-
def test_lcc_example
|
57
|
-
errors = JSON::Validator.fully_validate(@@schema , @@ex + 'lcc_project_example.json')
|
58
|
-
assert(errors.empty?, errors.join("\n"))
|
59
|
-
end
|
60
|
-
|
61
|
-
def test_contact
|
62
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/contact.json', @@ex + 'contact.json')
|
63
|
-
assert(errors.empty?, errors.join("\n"))
|
64
|
-
end
|
65
|
-
|
66
|
-
def test_citation
|
67
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/citation.json', @@ex + 'citation.json', :list => true)
|
68
|
-
assert(errors.empty?, errors.join("\n"))
|
69
|
-
end
|
70
|
-
|
71
|
-
def test_dictionary
|
72
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/dataDictionary.json', @@ex + 'dataDictionary.json', :list => true)
|
73
|
-
assert(errors.empty?, errors.join("\n"))
|
74
|
-
end
|
75
|
-
|
76
|
-
def test_taxonomy
|
77
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/taxonomy.json', @@ex + 'taxonomy.json', :list => true)
|
78
|
-
assert(errors.empty?, errors.join("\n"))
|
79
|
-
end
|
80
|
-
|
81
|
-
def test_usage
|
82
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/usage.json', @@ex + 'usage.json', :list => true)
|
83
|
-
assert(errors.empty?, errors.join("\n"))
|
84
|
-
end
|
85
|
-
|
86
|
-
def test_resolution
|
87
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/resolution.json', @@ex + 'resolution.json', :list => true)
|
88
|
-
assert(errors.empty?, errors.join("\n"))
|
89
|
-
end
|
90
|
-
|
91
|
-
def test_graphicOverview
|
92
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/graphicOverview.json', @@ex + 'graphicOverview.json', :list => true)
|
93
|
-
assert(errors.empty?, errors.join("\n"))
|
94
|
-
end
|
95
|
-
|
96
|
-
def test_resourceInfo
|
97
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/resourceInfo.json', @@ex + 'resourceInfo.json', :list => true)
|
98
|
-
assert(errors.empty?, errors.join("\n"))
|
99
|
-
end
|
100
|
-
|
101
|
-
def test_metadataInfo
|
102
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/metadata.json', @@ex + 'metadataInfo.json', :fragment => "#/properties/metadataInfo", :list => true)
|
103
|
-
assert(errors.empty?, errors.join("\n"))
|
104
|
-
end
|
105
|
-
|
106
|
-
def test_onlineResource
|
107
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/onlineResource.json', @@ex + 'onlineResource.json', :list => true)
|
108
|
-
assert(errors.empty?, errors.join("\n"))
|
109
|
-
end
|
110
|
-
|
111
|
-
def test_resourceConstraint
|
112
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/resourceConstraint.json', @@ex + 'legalConstraints.json', :fragment => "#/definitions/legalConstraint", :list => true)
|
113
|
-
assert(errors.empty?, errors.join("\n"))
|
114
|
-
|
115
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/resourceConstraint.json', @@ex + 'securityConstraints.json', :fragment => "#/definitions/securityConstraint", :list => true)
|
116
|
-
assert(errors.empty?, errors.join("\n"))
|
117
|
-
|
118
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/resourceConstraint.json', ["not for suitable for navigation", "draft version", "not intended for general use"], :fragment => "#/definitions/useLimitation", :list => true)
|
119
|
-
assert(errors.empty?, errors.join("\n"))
|
120
|
-
end
|
121
|
-
|
122
|
-
def test_date
|
123
|
-
errors = JSON::Validator.fully_validate(@@schema, @@ex + 'date.json', :fragment => "#/definitions/date", :list => true)
|
124
|
-
assert(errors.empty?, errors.join("\n"))
|
125
|
-
end
|
126
|
-
|
127
|
-
def test_spatialRef
|
128
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/resourceInfo.json', @@ex + 'spatialRef.json', :fragment => "#/properties/spatialReferenceSystem", :list => false)
|
129
|
-
assert(errors.empty?, errors.join("\n"))
|
130
|
-
end
|
131
|
-
|
132
|
-
def test_contactRef
|
133
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/contact.json', @@ex + 'contactRef.json', :fragment => "#/definitions/contactRef", :list => true)
|
134
|
-
assert(errors.empty?, errors.join("\n"))
|
135
|
-
end
|
136
|
-
|
137
|
-
def test_keywords
|
138
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/keyword.json', @@ex + 'keywords.json', :list => true)
|
139
|
-
assert(errors.empty?, errors.join("\n"))
|
140
|
-
end
|
141
|
-
|
142
|
-
def test_distributor
|
143
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/distributor.json', @@ex + 'distributor.json', :list => true)
|
144
|
-
assert(errors.empty?, errors.join("\n"))
|
145
|
-
|
146
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/distributor.json', @@ex + 'format.json', :fragment => "#/definitions/format", :list => true)
|
147
|
-
assert(errors.empty?, errors.join("\n"))
|
148
|
-
end
|
149
|
-
|
150
|
-
def test_geojson
|
151
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/geojson/geojson.json', @@ex + 'geojson.json', :list => true)
|
152
|
-
assert(errors.empty?, errors.join("\n"))
|
153
|
-
end
|
154
|
-
|
155
|
-
def test_extent_linestring
|
156
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/extent.json', @@ex + 'extent_linestring.json', :list => true)
|
157
|
-
assert(errors.empty?, errors.join("\n"))
|
158
|
-
end
|
159
|
-
|
160
|
-
def test_extent_point
|
161
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/extent.json', @@ex + 'extent_point.json', :list => true)
|
162
|
-
assert(errors.empty?, errors.join("\n"))
|
163
|
-
end
|
164
|
-
|
165
|
-
def test_extent_polygon
|
166
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/extent.json', @@ex + 'extent_polygon.json', :list => true)
|
167
|
-
assert(errors.empty?, errors.join("\n"))
|
168
|
-
end
|
169
|
-
|
170
|
-
def test_extent_temporal
|
171
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/extent.json', @@ex + 'temporalElement.json', :fragment => "#/definitions/temporalElement", :list => true)
|
172
|
-
assert(errors.empty?, errors.join("\n"))
|
173
|
-
end
|
174
|
-
|
175
|
-
def test_extent_vertical
|
176
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/extent.json', @@ex + 'verticalExtent.json', :fragment => "#/definitions/verticalExtent", :list => true)
|
177
|
-
assert(errors.empty?, errors.join("\n"))
|
178
|
-
end
|
179
|
-
|
180
|
-
def test_maintInfo
|
181
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/maintInfo.json', @@ex + 'maintInfo.json', :list => true)
|
182
|
-
errors = errors + JSON::Validator.fully_validate(@@dir + 'schema/maintInfo.json', @@ex + 'resourceMaintenance.json', :list => true)
|
183
|
-
assert(errors.empty?, errors.join("\n"))
|
184
|
-
end
|
185
|
-
|
186
|
-
def test_dataQuality
|
187
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/dataQuality.json', @@ex + 'dataQuality.json', :list => true)
|
188
|
-
assert(errors.empty?, errors.join("\n"))
|
189
|
-
end
|
190
|
-
|
191
|
-
def test_uri
|
192
|
-
errors = JSON::Validator.fully_validate(@@schema, @@ex + 'uri.json', :fragment => "#/definitions/uri", :list => true)
|
193
|
-
assert(errors.empty?, errors.join("\n"))
|
194
|
-
end
|
195
|
-
|
196
|
-
def test_additionalDocumentation
|
197
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/metadata.json', @@ex + 'additionalDocumentation.json', :fragment => "#/properties/additionalDocumentation", :list => false)
|
198
|
-
assert(errors.empty?, errors.join("\n"))
|
199
|
-
end
|
200
|
-
|
201
|
-
def test_associatedResource
|
202
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/metadata.json', @@ex + 'associatedResource.json', :fragment => "#/properties/associatedResource", :list => false)
|
203
|
-
assert(errors.empty?, errors.join("\n"))
|
204
|
-
end
|
205
|
-
|
206
|
-
def test_address
|
207
|
-
errors = JSON::Validator.fully_validate(@@dir + 'schema/contact.json', @@ex + 'address.json', :fragment => "#/definitions/address", :list => true)
|
208
|
-
assert(errors.empty?, errors.join("\n"))
|
209
|
-
end
|
210
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
* Description: Test Utility functions
|
3
|
-
* Author: Josh Bradley
|
4
|
-
* Date: 2014-05-06
|
5
|
-
* License: Public Domain
|
6
|
-
=end
|
7
|
-
|
8
|
-
require 'minitest/autorun'
|
9
|
-
require File.join(File.dirname(__FILE__),'..','lib', 'adiwg-mdjson_schemas.rb')
|
10
|
-
|
11
|
-
class TestUtils < Minitest::Test
|
12
|
-
def test_examples_dir
|
13
|
-
puts ADIWG::MdjsonSchemas::Utils.examples_dir
|
14
|
-
errors = File.exist?(ADIWG::MdjsonSchemas::Utils.examples_dir)
|
15
|
-
assert_equal( true, errors, failure_message = 'Examples directory does not exist.')
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_schema_path
|
19
|
-
errors = File.file?(ADIWG::MdjsonSchemas::Utils.schema_path)
|
20
|
-
assert_equal( true, errors, failure_message = 'File schema.json does not exist.')
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_schema_dir
|
24
|
-
errors = File.exist?(ADIWG::MdjsonSchemas::Utils.schema_dir)
|
25
|
-
assert_equal( true, errors, failure_message = 'Schema directory does not exist.')
|
26
|
-
end
|
27
|
-
end
|