easy_json_matcher 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 38bf4b35911453e6c50e3e396c50304e0fb64ae3
4
- data.tar.gz: b6eea15e635baf07897ec99016a13587569f77b8
3
+ metadata.gz: 9d89a8713abb0a107d389588fc6ab8276b97a73e
4
+ data.tar.gz: 1a984ae9ebf4154fe92ed59b4d551aed3d31949d
5
5
  SHA512:
6
- metadata.gz: 3c0f60deadb481e19909041df4493883c1ac713d1808c528be17917c38f02d438d92891ba7b719cff76a1f4ac77f9f82272de1732c183b39a589fb57bc0a84e2
7
- data.tar.gz: a2a2e664081b54bb035f7d64325748356cdff8afcd1579d70efafb0ae71a1c0f111aae321862d2f5b886459dd3dd0d0b71852bc61faaa14158c7df4fe5a5edc7
6
+ metadata.gz: 3859e9e26ccd582d6cd76438b7dfb27f852211dcce7e2863050e1f48981de0539ff3835571b02fe1de45ade149f11cc46c31ec776d403d80e315d0dbd81a758c
7
+ data.tar.gz: 4f9486b504b527d7ab1a081538cdfa5e401c7a69ebf3b3ecbe3ed187a9dd0616828fe5958679f2e3d4c91031c2c6846f79a5f745dd4a1b4a3406d4c121048f3a
@@ -24,6 +24,10 @@ module EasyJSONMatcher
24
24
  schema
25
25
  end
26
26
 
27
+ def use_schema(name:, wrap_with: Validator)
28
+ wrap_with.new validate_with: SCHEMAS[name]
29
+ end
30
+
27
31
  def _find_and_clone_schema(name)
28
32
  s = SCHEMAS[name]
29
33
  return s.dup if s or nil
@@ -1,3 +1,3 @@
1
1
  module EasyJSONMatcher
2
- VERSION = "0.3.1".freeze
2
+ VERSION = "0.3.2".freeze
3
3
  end
@@ -19,7 +19,7 @@ module EasyJSONMatcher
19
19
  candidate = {
20
20
  name: "Green Mandarin"
21
21
  }.to_json
22
- schema = Validator.new validate_with: SchemaLibrary.get_schema(name: @name)
22
+ schema = SchemaLibrary.use_schema(name: @name)
23
23
  assert(schema.valid?(candidate: candidate), "test_schema did not validate correctly")
24
24
  end
25
25
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_json_matcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - WJD Hamilton