lib/json_matchers/matcher.rb in json_matchers-0.7.3 vs lib/json_matchers/matcher.rb in json_matchers-0.8.0

- old
+ new

@@ -6,12 +6,12 @@ def initialize(schema_path, options = {}) @schema_path = schema_path @options = default_options.merge(options) end - def matches?(response) - validator = build_validator(response) + def matches?(payload) + validator = build_validator(payload) self.errors = validator.validate! errors.empty? rescue JSON::Schema::ValidationError => error @@ -32,13 +32,13 @@ def default_options JsonMatchers.configuration.options || {} end - def build_validator(response) + def build_validator(payload) Validator.new( options: options, - response: response, + payload: payload, schema_path: schema_path, ) end end end