Sha256: 9d60e966900649fdd351c83e9c9aebae16dd13e7f947b8a3ffe79213fc9f6fc2

Contents?: true

Size: 933 Bytes

Versions: 112

Compression:

Stored size: 933 Bytes

Contents

require 'spec_helper'
require 'spec/support/test_data_builder'
require 'pact_broker/api/decorators/representable_pact'

module PactBroker::Api::Decorators
  describe RepresentablePact do
    let(:pact) { TestDataBuilder.new.create_pact_with_hierarchy('Consumer', '1.2.3', 'Provider').and_return(:pact) }

    subject { RepresentablePact.new(pact) }

    describe "initialize" do
      it "creates an object with a provider with a name" do
        expect(subject.provider.name).to eq 'Provider'
      end

      it "creates an object with a provider with a nil version" do
        expect(subject.provider.version).to be_nil
      end

      it "creates an object with a consumer with a name" do
        expect(subject.consumer.name).to eq 'Consumer'
      end

      it "creates an object with a consumer that has the current pact's version" do
        expect(subject.consumer.version.number).to eq '1.2.3'
      end
    end
  end
end

Version data entries

112 entries across 112 versions & 1 rubygems

Version Path
pact_broker-2.23.3 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.23.2 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.23.1 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.23.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.22.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.21.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.20.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.19.2 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.19.1 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.19.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.18.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.17.1 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.17.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.16.1 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.16.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.15.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.14.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.13.1 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.13.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.12.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb