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.79.1 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.79.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.78.1 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.78.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.77.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.76.2 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.76.1 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.76.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.75.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.74.1 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.74.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.73.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.72.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.71.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.70.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.69.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.68.1 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.68.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.67.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb
pact_broker-2.66.0 spec/lib/pact_broker/api/decorators/representable_pact_spec.rb