Skip to content

Commit

Permalink
improve json schema test data directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
jfredrickson committed Jul 27, 2020
1 parent 4db5f4d commit a0f6928
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions test/test_datajson.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

0 comments on commit a0f6928

Please sign in to comment.