From a0f692835cfc5d35418467dadae7cc842862e60e Mon Sep 17 00:00:00 2001 From: Jeff Fredrickson Date: Mon, 27 Jul 2020 10:17:16 -0600 Subject: [PATCH] improve json schema test data directory structure --- test/schema/{ => data}/catalog.json | 0 test/schema/{ => data}/catalog.jsonld | 0 test/schema/{ => data}/dataset.json | 0 test/schema/{ => data}/distribution.json | 0 test/schema/{ => data}/organization.json | 0 test/schema/{ => data}/vcard.json | 0 test/test_datajson.rb | 4 ++-- 7 files changed, 2 insertions(+), 2 deletions(-) rename test/schema/{ => data}/catalog.json (100%) rename test/schema/{ => data}/catalog.jsonld (100%) rename test/schema/{ => data}/dataset.json (100%) rename test/schema/{ => data}/distribution.json (100%) rename test/schema/{ => data}/organization.json (100%) rename test/schema/{ => data}/vcard.json (100%) diff --git a/test/schema/catalog.json b/test/schema/data/catalog.json similarity index 100% rename from test/schema/catalog.json rename to test/schema/data/catalog.json diff --git a/test/schema/catalog.jsonld b/test/schema/data/catalog.jsonld similarity index 100% rename from test/schema/catalog.jsonld rename to test/schema/data/catalog.jsonld diff --git a/test/schema/dataset.json b/test/schema/data/dataset.json similarity index 100% rename from test/schema/dataset.json rename to test/schema/data/dataset.json diff --git a/test/schema/distribution.json b/test/schema/data/distribution.json similarity index 100% rename from test/schema/distribution.json rename to test/schema/data/distribution.json diff --git a/test/schema/organization.json b/test/schema/data/organization.json similarity index 100% rename from test/schema/organization.json rename to test/schema/data/organization.json diff --git a/test/schema/vcard.json b/test/schema/data/vcard.json similarity index 100% rename from test/schema/vcard.json rename to test/schema/data/vcard.json diff --git a/test/test_datajson.rb b/test/test_datajson.rb index b47541c0c..231840da7 100644 --- a/test/test_datajson.rb +++ b/test/test_datajson.rb @@ -3,7 +3,7 @@ class TestDataJson < Test::Unit::TestCase def test_valid_data_json - schema_path = File.join(__dir__, "schema", "catalog.json") + schema_path = File.join(__dir__, "schema", "data", "catalog.json") datajson_path = File.join(__dir__, "..", "data.json") assert_nothing_raised(JSON::Schema::ValidationError) { JSON::Validator.validate!(schema_path, datajson_path, schema_reader: SchemaReader.new) @@ -15,7 +15,7 @@ def test_valid_data_json class SchemaReader < JSON::Schema::Reader def read(location) filename = URI(location).path.split('/').last - body = read_file(File.join(__dir__, "schema", filename)) + body = read_file(File.join(__dir__, "schema", "data", filename)) JSON::Schema.new(JSON::Validator.parse(body), location) end end