Sha256: faed8839baeb24dfe52695a47ea31c48b6830eee4e94059a869ebece5b5c551e

Contents?: true

Size: 709 Bytes

Versions: 4

Compression:

Stored size: 709 Bytes

Contents

require 'rspec'
require 'pact/matchers'
require 'pact/provider/matchers/messages'

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

  include Pact::Matchers
  include Pact::Matchers::Messages

  match do |actual|
    (@difference = diff(expected, actual)).empty?
  end

  failure_message_for_should do | actual |
    match_term_failure_message @difference, ::RSpec.configuration.color_enabled
  end

end

RSpec::Matchers.define :match_header do |header_name, expected|

  include Pact::Matchers
  include Pact::Matchers::Messages

  match do |actual|
    diff(expected, actual).empty?
  end

  failure_message_for_should do | actual |
    match_header_failure_message header_name, expected, actual
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pact-1.1.0 lib/pact/provider/matchers.rb
pact-1.1.0.rc5 lib/pact/provider/matchers.rb
pact-1.1.0.rc4 lib/pact/provider/matchers.rb
pact-1.1.0.rc3 lib/pact/provider/matchers.rb