Sha256: 318ded12e2f4ab72d1b54bbf85f960232e4687446fed304752acc7261c6c2b9d

Contents?: true

Size: 278 Bytes

Versions: 5

Compression:

Stored size: 278 Bytes

Contents

RSpec::Matchers.define :match_response_schema do |schema|
  match do |response|
    schema_directory = "#{Dir.pwd}/spec/support/api/schemas"
    schema_path = "#{schema_directory}/#{schema}.json"
    JSON::Validator.validate!(schema_path, response.body, strict: true)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
voyage-1.44.0.14 lib/voyage/templates/specs/support/matchers/api_schema_matcher.rb
voyage-1.44.0.13 lib/voyage/templates/specs/support/matchers/api_schema_matcher.rb
voyage-1.44.0.11 lib/voyage/templates/specs/support/matchers/api_schema_matcher.rb
voyage-1.44.0.12 lib/voyage/templates/specs/support/matchers/api_schema_matcher.rb
voyage-1.44.0.10 lib/voyage/templates/specs/support/matchers/api_schema_matcher.rb