Sha256: d76580b0ae83b063b22fb280d115df5ca7e5b611f7ea9f241a8b6d36a2ed678f

Contents?: true

Size: 1.34 KB

Versions: 37

Compression:

Stored size: 1.34 KB

Contents

require 'pact_broker/pacts/selector'

module PactBroker
  module Pacts
    describe Selector do
      describe "<=>" do
        let(:overall_latest_1) { Selector.overall_latest }
        let(:overall_latest_2) { Selector.overall_latest }
        let(:latest_for_tag_prod) { Selector.latest_for_tag('prod') }
        let(:latest_for_tag_dev) { Selector.latest_for_tag('dev') }
        let(:all_prod_for_consumer_1) { Selector.all_for_tag_and_consumer('prod', 'Foo') }
        let(:all_prod_for_consumer_2) { Selector.all_for_tag_and_consumer('prod', 'Bar') }
        let(:all_dev_for_consumer_1) { Selector.all_for_tag_and_consumer('dev', 'Bar') }
        let(:all_prod) { Selector.all_for_tag('prod') }
        let(:all_dev) { Selector.all_for_tag('dev') }

        let(:unsorted_selectors) do
          [all_prod, all_dev, all_dev_for_consumer_1, latest_for_tag_prod, overall_latest_1, overall_latest_1, latest_for_tag_dev, all_prod_for_consumer_2, all_prod_for_consumer_1]
        end

        let(:expected_sorted_selectors) do
          [overall_latest_1, overall_latest_1, latest_for_tag_dev, latest_for_tag_prod, all_dev_for_consumer_1, all_prod_for_consumer_2, all_prod_for_consumer_1, all_dev, all_prod]
        end

        it "sorts the selectors" do
          expect(unsorted_selectors.sort).to eq(expected_sorted_selectors)
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
pact_broker-2.76.2 spec/lib/pact_broker/pacts/selector_spec.rb
pact_broker-2.76.1 spec/lib/pact_broker/pacts/selector_spec.rb
pact_broker-2.76.0 spec/lib/pact_broker/pacts/selector_spec.rb
pact_broker-2.75.0 spec/lib/pact_broker/pacts/selector_spec.rb
pact_broker-2.74.1 spec/lib/pact_broker/pacts/selector_spec.rb
pact_broker-2.74.0 spec/lib/pact_broker/pacts/selector_spec.rb
pact_broker-2.73.0 spec/lib/pact_broker/pacts/selector_spec.rb
pact_broker-2.72.0 spec/lib/pact_broker/pacts/selector_spec.rb
pact_broker-2.71.0 spec/lib/pact_broker/pacts/selector_spec.rb
pact_broker-2.70.0 spec/lib/pact_broker/pacts/selector_spec.rb
pact_broker-2.69.0 spec/lib/pact_broker/pacts/selector_spec.rb
pact_broker-2.68.1 spec/lib/pact_broker/pacts/selector_spec.rb
pact_broker-2.68.0 spec/lib/pact_broker/pacts/selector_spec.rb
pact_broker-2.67.0 spec/lib/pact_broker/pacts/selector_spec.rb
pact_broker-2.66.0 spec/lib/pact_broker/pacts/selector_spec.rb
pact_broker-2.65.0 spec/lib/pact_broker/pacts/selector_spec.rb
pact_broker-2.64.0 spec/lib/pact_broker/pacts/selector_spec.rb
pact_broker-2.63.0 spec/lib/pact_broker/pacts/selector_spec.rb
pact_broker-2.62.0 spec/lib/pact_broker/pacts/selector_spec.rb
pact_broker-2.61.0 spec/lib/pact_broker/pacts/selector_spec.rb