Sha256: 12e4afe79d188f886b6d30966859f9237a1c3d2d68ba90aa2b1a1f35de63cd58

Contents?: true

Size: 763 Bytes

Versions: 1

Compression:

Stored size: 763 Bytes

Contents

require 'spec_helper'
require 'pact/matchers/difference'

module Pact
  module Matchers
    describe Difference do

      describe "#to_hash" do

        context "when a regexp is expected" do

          subject { Difference.new(/ap/, 'pear').to_hash }

          it "indicates that the actual was indended 'to match'" do
            expect(subject).to eq({:EXPECTED_TO_MATCH => "/ap/", :ACTUAL => "pear"})
          end

        end

        context "when something other than a regexp is expected" do

          subject { Difference.new("apple", 'pear').to_hash }

          it "indicates that the actual was intended 'to eq'" do
            expect(subject).to eq({:EXPECTED => "apple", :ACTUAL => "pear"})
          end
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pact-1.1.0.rc2 spec/lib/pact/matchers/difference_spec.rb