Sha256: b75245c2fc9d5ddf71ad60aa31a8063d970343069a72d64525cfe47f12293f96

Contents?: true

Size: 327 Bytes

Versions: 1

Compression:

Stored size: 327 Bytes

Contents

# Matchers to check a json schema
require "json_schema"

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hexx-0.1.0 lib/generators/install/templates/spec/json_shema.erb