Sha256: 36492f5872d081db1544579568ba4d080651d2226feb36985f101a6840c70839

Contents?: true

Size: 854 Bytes

Versions: 10

Compression:

Stored size: 854 Bytes

Contents

require 'spec_helper'

module Pact
  describe Term do

    describe "equality" do
      context "when the matcher and generate attrs are the same" do
        let(:this) { Term.new(generate: 'A', matcher: /A/) }
        let(:that) { Term.new(generate: 'A', matcher: /A/) }

        it "is equal" do
          expect(this).to eq that
        end
      end

      context "when the generate attrs are different" do
        let(:this) { Term.new(generate: /A/) }
        let(:that) { Term.new(generate: /B/) }

        it "is not equal" do
          expect(this).to_not eq that
        end
      end

      context "when the matcher attrs are different" do
        let(:this) { Term.new(matcher: 'A') }
        let(:that) { Term.new(matcher: 'B') }

        it "is not equal" do
          expect(this).to_not eq that
        end
      end
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
pact-1.0.6 spec/lib/pact/term_spec.rb
pact-1.0.5 spec/lib/pact/term_spec.rb
pact-1.0.4 spec/lib/pact/term_spec.rb
pact-1.0.3 spec/lib/pact/term_spec.rb
pact-1.0.2 spec/lib/pact/term_spec.rb
pact-1.0.1 spec/lib/pact/term_spec.rb
pact-1.0.0 spec/lib/pact/term_spec.rb
pact-0.1.37 spec/lib/pact/term_spec.rb
pact-0.1.35 spec/lib/pact/term_spec.rb
pact-0.1.28 spec/lib/pact/term_spec.rb