Sha256: da3b509961af1c6dfd3b25d2b1f15b73a500379e20a75ff4ed062a615febe7ee

Contents?: true

Size: 549 Bytes

Versions: 2

Compression:

Stored size: 549 Bytes

Contents

require 'pact/term'
require 'awesome_print'
require 'pact/matchers'
require 'awesome_print'
require 'rspec'
require 'pact/matchers/nested_json_diff_decorator'
require 'pact/matchers/diff_decorator'

RSpec::Matchers.define :match_term do |expected|
  include Pact::Matchers

  match do |actual|
    if (difference = diff(expected, actual)).any?
      @diff_decorator = Pact.configuration.diff_formatter_class.new(difference)
      false
    else
      true
    end
  end

  failure_message_for_should do | actual |
    @diff_decorator.to_s
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pact-1.1.0.rc2 lib/pact/provider/matchers.rb
pact-1.1.0.rc1 lib/pact/provider/matchers.rb