Sha256: cedc0282012994ef45c94431362191e17976d6e6ebbce991dce4ad64b73e4d35

Contents?: true

Size: 246 Bytes

Versions: 4

Compression:

Stored size: 246 Bytes

Contents

require 'json-schema'
require 'rspec/expectations'

RSpec::Matchers.define :match_json_schema do |schema, options|
  match do |json|
    options = {strict: true}.merge!(options || {})
    JSON::Validator.validate!(schema, json, options)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
apress-api-1.24.0 lib/apress/api/testing/json_matcher.rb
apress-api-1.23.0 lib/apress/api/testing/json_matcher.rb
apress-api-1.22.1 lib/apress/api/testing/json_matcher.rb
apress-api-1.22.0 lib/apress/api/testing/json_matcher.rb