diff options
| author | mo khan <mo.khan@gmail.com> | 2020-01-15 14:41:14 -0700 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-01-15 15:03:09 -0700 |
| commit | ac9634d8f8c6bbaa8348929f42d53d2b375f6dfb (patch) | |
| tree | d54a73c7bd9172fa5e7dbec4dd05f3f639f7831b /spec/support | |
| parent | 3aeed26912b238f6cb9c8b43587b0f3a7bf181f4 (diff) | |
Add a json schema for dependency
Diffstat (limited to 'spec/support')
| -rw-r--r-- | spec/support/matchers.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index bb54d19..1d1c263 100644 --- a/spec/support/matchers.rb +++ b/spec/support/matchers.rb @@ -1,8 +1,9 @@ -RSpec::Matchers.define :match_schema do |version: nil, **options| +RSpec::Matchers.define :match_schema do |version: '2.0'| match do |actual| - path = License::Management.root.join("spec/fixtures/v#{version}_schema.json") - schema = JSON.parse(IO.read(path)) - @errors = JSON::Validator.fully_validate(schema, actual, options) + schema = License::Management.root + .join("spec/fixtures/schema/v#{version}.json") + .to_s + @errors = JSON::Validator.fully_validate(schema, actual) @errors.empty? end |
