diff options
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 |
