adiwg-mdjson_schemas 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/test/tc_schemas.rb CHANGED
@@ -19,6 +19,10 @@ class TestExamples < Minitest::Test
19
19
  @@ex = File.join(File.dirname(__FILE__),'..','examples/')
20
20
  @@schema = File.join(File.dirname(__FILE__),'..','schema','schema.json')
21
21
 
22
+ def load_json( filename )
23
+ JSON.load File.new( filename )
24
+ end
25
+
22
26
  def test_schemas
23
27
  #Validate the schemas themselves
24
28
  #puts "\nValidating schemas, Please wait... \n"
@@ -59,10 +63,31 @@ class TestExamples < Minitest::Test
59
63
  end
60
64
 
61
65
  def test_contact
66
+ errors = JSON::Validator.fully_validate(@@dir + 'schema/contact.json', load_json(@@ex + 'contact.json')[0], :fragment => "#/definitions/individual",:strict => true)
67
+ assert(errors.empty?, errors.join("\n"))
68
+
62
69
  errors = JSON::Validator.fully_validate(@@dir + 'schema/contact.json', @@ex + 'contact.json')
63
70
  assert(errors.empty?, errors.join("\n"))
64
71
  end
65
72
 
73
+ def test_locale
74
+ errors = JSON::Validator.fully_validate(@@dir + 'schema/locale.json', @@ex + 'locale.json', :strict => true)
75
+ assert(errors.empty?, errors.join("\n"))
76
+ end
77
+
78
+ def test_gridInfo
79
+ errors = JSON::Validator.fully_validate(@@dir + 'schema/gridInfo.json', @@ex + 'gridInfo.json', :strict => true)
80
+ assert(errors.empty?, errors.join("\n"))
81
+ end
82
+
83
+ def test_coverageInfo
84
+ errors = JSON::Validator.fully_validate(@@dir + 'schema/coverageInfo.json', load_json(@@ex + 'coverageInfo.json')[0], :strict => true)
85
+ assert(errors.empty?, errors.join("\n"))
86
+
87
+ errors = JSON::Validator.fully_validate(@@dir + 'schema/coverageInfo.json', @@ex + 'coverageInfo.json', :list => true)
88
+ assert(errors.empty?, errors.join("\n"))
89
+ end
90
+
66
91
  def test_citation
67
92
  errors = JSON::Validator.fully_validate(@@dir + 'schema/citation.json', @@ex + 'citation.json', :list => true)
68
93
  assert(errors.empty?, errors.join("\n"))
@@ -140,8 +165,16 @@ class TestExamples < Minitest::Test
140
165
  end
141
166
 
142
167
  def test_distributor
168
+ errors = JSON::Validator.fully_validate(@@dir + 'schema/distributor.json', load_json(@@ex + 'distributor.json')[0], :strict => true)
169
+ assert(errors.empty?, errors.join("\n"))
170
+
143
171
  errors = JSON::Validator.fully_validate(@@dir + 'schema/distributor.json', @@ex + 'distributor.json', :list => true)
144
172
  assert(errors.empty?, errors.join("\n"))
173
+ end
174
+
175
+ def test_format
176
+ errors = JSON::Validator.fully_validate(@@dir + 'schema/distributor.json', load_json(@@ex + 'format.json')[0],:fragment => "#/definitions/format", :strict => true)
177
+ assert(errors.empty?, errors.join("\n"))
145
178
 
146
179
  errors = JSON::Validator.fully_validate(@@dir + 'schema/distributor.json', @@ex + 'format.json', :fragment => "#/definitions/format", :list => true)
147
180
  assert(errors.empty?, errors.join("\n"))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adiwg-mdjson_schemas
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Bradley, Stan Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-01 00:00:00.000000000 Z
11
+ date: 2015-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -89,6 +89,7 @@ files:
89
89
  - examples/citation.json
90
90
  - examples/contact.json
91
91
  - examples/contactRef.json
92
+ - examples/coverageInfo.json
92
93
  - examples/dataDictionary.json
93
94
  - examples/dataQuality.json
94
95
  - examples/date.json
@@ -101,10 +102,12 @@ files:
101
102
  - examples/full_example2.json
102
103
  - examples/geojson.json
103
104
  - examples/graphicOverview.json
105
+ - examples/gridInfo.json
104
106
  - examples/hierarchyLevel.json
105
107
  - examples/keywords.json
106
108
  - examples/lcc_project_example.json
107
109
  - examples/legalConstraints.json
110
+ - examples/locale.json
108
111
  - examples/maintInfo.json
109
112
  - examples/metadataInfo.json
110
113
  - examples/minimum_example.json
@@ -127,6 +130,7 @@ files:
127
130
  - schema/schema.json
128
131
  - schema/schema/citation.json
129
132
  - schema/schema/contact.json
133
+ - schema/schema/coverageInfo.json
130
134
  - schema/schema/dataDictionary.json
131
135
  - schema/schema/dataQuality.json
132
136
  - schema/schema/distributor.json
@@ -136,7 +140,9 @@ files:
136
140
  - schema/schema/geojson/geojson.json
137
141
  - schema/schema/geojson/geometry.json
138
142
  - schema/schema/graphicOverview.json
143
+ - schema/schema/gridInfo.json
139
144
  - schema/schema/keyword.json
145
+ - schema/schema/locale.json
140
146
  - schema/schema/maintInfo.json
141
147
  - schema/schema/metadata.json
142
148
  - schema/schema/onlineResource.json