schema_matcher 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/schema_matcher/rspec_matchers.rb +6 -5
- data/lib/schema_matcher/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51684856418fd56fd7ef6a7faabc9c46be7be6110a48110be1870cb2ee1038e5
|
4
|
+
data.tar.gz: 8e113af8073d7fa372c6411e568a73de2064776227c51f8f1ece2c688f62e36b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94cf1b55c50e0755ce16580e74fd193775f8863f884da398b15959ec4bdfe80abdeabf94a423b3df24f16a7355006ec579597e9b2ad2a648bcb3a41801aa8174
|
7
|
+
data.tar.gz: b4dc059a5d1de2ac2091fe791a669080d30c40d40ed8d19ea67676996c0fcae895b788d292ebeeefd65a93d575b79fbd177f81c4b2a9784db90a74e49f4021cb
|
@@ -4,13 +4,14 @@ require 'schema_matcher/assertion'
|
|
4
4
|
module SchemaMatcher
|
5
5
|
module RspecMatchers
|
6
6
|
class JsonSchemaMatcher
|
7
|
-
attr_reader :schema_name, :payload, :assertion
|
7
|
+
attr_reader :schema_name, :payload, :assertion, :options
|
8
8
|
|
9
|
-
def initialize(schema_name)
|
9
|
+
def initialize(schema_name, options = {})
|
10
10
|
@schema_name = schema_name
|
11
|
+
@options = options
|
11
12
|
end
|
12
13
|
|
13
|
-
def matches?(payload
|
14
|
+
def matches?(payload)
|
14
15
|
@payload = payload
|
15
16
|
@assertion = SchemaMatcher::Assertion.new(schema_name, payload, options)
|
16
17
|
@assertion.valid?
|
@@ -63,8 +64,8 @@ module SchemaMatcher
|
|
63
64
|
end
|
64
65
|
end
|
65
66
|
|
66
|
-
def match_json_schema(schema)
|
67
|
-
JsonSchemaMatcher.new(schema)
|
67
|
+
def match_json_schema(schema, options = {})
|
68
|
+
JsonSchemaMatcher.new(schema, options)
|
68
69
|
end
|
69
70
|
end
|
70
71
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schema_matcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Rudskikh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json-schema
|