diff options
Diffstat (limited to 'spec/support/matchers.rb')
| -rw-r--r-- | spec/support/matchers.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index 1d1c263..12bbdf7 100644 --- a/spec/support/matchers.rb +++ b/spec/support/matchers.rb @@ -1,10 +1,9 @@ RSpec::Matchers.define :match_schema do |version: '2.0'| + def schema_for(version) + License::Management.root.join("spec/fixtures/schema/v#{version}.json").to_s + end match do |actual| - schema = License::Management.root - .join("spec/fixtures/schema/v#{version}.json") - .to_s - @errors = JSON::Validator.fully_validate(schema, actual) - @errors.empty? + !actual.nil? && JSON::Validator.fully_validate(schema_for(version), actual).empty? end failure_message do |response| |
