Module: Pact::Matchers
- Included in:
- FormDiffer, JsonDiffer, QueryHash, QueryString, Request::Base, Request::Base, TextDiffer
- Defined in:
- lib/pact/matchers/differ.rb,
lib/pact/matchers/matchers.rb,
lib/pact/matchers/difference.rb,
lib/pact/matchers/base_difference.rb,
lib/pact/matchers/type_difference.rb,
lib/pact/matchers/no_diff_at_index.rb,
lib/pact/matchers/regexp_difference.rb,
lib/pact/matchers/list_diff_formatter.rb,
lib/pact/matchers/unix_diff_formatter.rb,
lib/pact/matchers/embedded_diff_formatter.rb
Defined Under Namespace
Classes: BaseDifference, Differ, Difference, EmbeddedDiffFormatter, ListDiffFormatter, NoDiffAtIndex, RegexpDifference, TypeDifference, UnixDiffFormatter
Constant Summary
collapse
- NO_DIFF_AT_INDEX =
NoDiffAtIndex.new
- DEFAULT_OPTIONS =
{allow_unexpected_keys: true, type: false}.freeze
- NO_DIFF =
{}.freeze
Instance Method Summary
collapse
Instance Method Details
#diff(expected, actual, opts = {}) ⇒ Object
23
24
25
|
# File 'lib/pact/matchers/matchers.rb', line 23
def diff expected, actual, opts = {}
calculate_diff(Pact::Term.unpack_regexps(expected), actual, DEFAULT_OPTIONS.merge(opts))
end
|
#type_diff(expected, actual, opts = {}) ⇒ Object
Also known as:
structure_diff
27
28
29
|
# File 'lib/pact/matchers/matchers.rb', line 27
def type_diff expected, actual, opts = {}
calculate_diff Pact::Term.unpack_regexps(expected), actual, DEFAULT_OPTIONS.merge(opts).merge(type: true)
end
|