Sha256: bd04053d19c53cb3b6e393adcd325439842ec592f458c04c4aa360760def07a0
Contents?: true
Size: 913 Bytes
Versions: 1
Compression:
Stored size: 913 Bytes
Contents
# * Description: Base helper class for tests of examples schemas and templates. # Any tests should inherit from this class. # * Author: Josh Bradley # * License: Public Domain require 'minitest/autorun' require 'json' require 'json-schema' require File.join(File.dirname(__FILE__), '..', 'lib', 'adiwg-mdjson_schemas.rb') class TestHelper < Minitest::Test @@dir = File.join(File.dirname(__FILE__), '..', '/') @@example = File.join(File.dirname(__FILE__), '..', 'examples/') @@schema = File.join(File.dirname(__FILE__), '..', 'schema', 'schema.json') @@strict = false def self.load_json(filename) JSON.load File.new(filename) end schemas = `git ls-files #{@@dir}/schema`.split($/) schemas.each do |schema| name = File.basename(schema) jschema = JSON::Schema.new(TestHelper.load_json(schema), Addressable::URI.parse(name)) JSON::Validator.add_schema(jschema) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
adiwg-mdjson_schemas-2.0.0.pre.alpha | test/helper.rb |