jsonschema-matchers 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aebdfa4f7482284b2db5b5f3d24cf5f4a6aac00eff228380c93f879195f312b7
4
- data.tar.gz: e69ae41eb4ce7bb22bc0939f6ae40d60f923fcad1f1e7ca0025c120e7f1323b0
3
+ metadata.gz: 376dbc86c2fda4f6e14a1c8442456b7ebb6093eb1b4d95e0787a3f06d0e6d1ef
4
+ data.tar.gz: 7a68f17ec58a5e779113d3b3f1236b7d1a97e352b9aeea5c954c815457d23880
5
5
  SHA512:
6
- metadata.gz: 67bb703f5766b938d90bc227254f61085d5b3c217e264c774b9fe08a6b5241baf90118990d98fac29405f40b68d76d563931a6ce688547ea2d5146de8bab6ff6
7
- data.tar.gz: e3116cc28a75a10dc540d98a23d3b3b8edeed01ed8519871552e02cec01fd3e72fcb5b9b7181039cd01740f2f437a53b1b1440e6df4b4a385316a23b9bf0397c
6
+ metadata.gz: 02dc52f0df17e22782fec7a020206fa369842f0377088225b503c10fe322e0a6f20c45b1b62e41be80abae548dd48997edbd78a95d2ee27eb94046f8b91e4989
7
+ data.tar.gz: f738b6b69563a72f1078ab6cbdd3504351b9100f224a9ee867d29c517542ef795d37a27186d2237bef916167f8619ca4bdce9cefcb09224f12dfebe191b2beae
@@ -13,8 +13,8 @@ module Jsonschema
13
13
  module Matchers
14
14
  class Error < StandardError; end
15
15
 
16
- def match_jsonschema
17
- MatchJsonschema.new(self.class.metadata)
16
+ def match_jsonschema(name)
17
+ MatchJsonschema.new(self.class.metadata, name)
18
18
  end
19
19
  end
20
20
  end
@@ -8,15 +8,14 @@ module Jsonschema
8
8
  class MatchJsonschema
9
9
  attr_reader :metadata, :path, :name, :errors
10
10
 
11
- def initialize(metadata)
11
+ def initialize(metadata, name)
12
12
  @metadata = metadata
13
13
  @path = "spec/jsonschemas/#{Metadater.call(metadata)}"
14
- scenario_name = metadata[:block].call.description
15
- @name = scenario_name.downcase.tr(' ', '_')
14
+ @name = name
16
15
  end
17
16
 
18
17
  def matches?(actual)
19
- file_full_path = path + '/' + name + '.json'
18
+ file_full_path = "#{path}/#{name}.json"
20
19
  record(actual) unless File.exist?(file_full_path)
21
20
  file = File.open(file_full_path)
22
21
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jsonschema
4
4
  module Matchers
5
- VERSION = '0.1.3'
5
+ VERSION = '0.1.4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonschema-matchers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Bykov