Sha256: 4d887ebe7d4902ecaf1407a1494b9d24a2f73f237dee21a345a089e8f1c974c0

Contents?: true

Size: 1.97 KB

Versions: 13

Compression:

Stored size: 1.97 KB

Contents

require 'pact_broker/metrics/service'

module PactBroker
  module Metrics
    module Service
      describe "#metrics" do
        subject { Service.metrics }

        describe "verificationResultsPerPactVersion" do
          before do
            td.create_pact_with_hierarchy
              .create_consumer_version_tag("prod")
              .comment("this pact version will have 2 verifications")
              .create_verification
              .create_verification(number: 2, tag_names: ["main"])
              .revise_pact
              .comment("this pact version will have 1 verification")
              .create_verification
              .create_consumer_version
              .create_consumer_version_tag("main")
              .create_pact
              .comment("this pact will have 1 verification")
              .create_verification
              .create_consumer_version
              .create_consumer_version_tag("main")
              .create_pact
              .comment("this pact will have 1 verification")
              .create_verification
          end

          let(:distribution) { subject[:verificationResultsPerPactVersion][:distribution] }

          it "returns a distribution of verifications per pact version" do
            expect(distribution).to eq(1 => 3, 2 => 1)
          end
        end

        describe "pactRevisionsPerPactPublication" do
          before do
            td.create_pact_with_hierarchy
              .comment("this consumer version will have 3 revisions")
              .revise_pact
              .revise_pact
              .create_consumer_version
              .create_pact
              .comment("this consumer version will have 1 revision")
              .revise_pact
          end

          let(:distribution) { subject[:pactRevisionsPerConsumerVersion][:distribution] }

          it "returns a distribution of pact revisions per consumer version" do
            expect(distribution).to eq(2 => 1, 3 => 1)
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
pact_broker-2.79.1 spec/lib/pact_broker/metrics/service_spec.rb
pact_broker-2.79.0 spec/lib/pact_broker/metrics/service_spec.rb
pact_broker-2.78.1 spec/lib/pact_broker/metrics/service_spec.rb
pact_broker-2.78.0 spec/lib/pact_broker/metrics/service_spec.rb
pact_broker-2.77.0 spec/lib/pact_broker/metrics/service_spec.rb
pact_broker-2.76.2 spec/lib/pact_broker/metrics/service_spec.rb
pact_broker-2.76.1 spec/lib/pact_broker/metrics/service_spec.rb
pact_broker-2.76.0 spec/lib/pact_broker/metrics/service_spec.rb
pact_broker-2.75.0 spec/lib/pact_broker/metrics/service_spec.rb
pact_broker-2.74.1 spec/lib/pact_broker/metrics/service_spec.rb
pact_broker-2.74.0 spec/lib/pact_broker/metrics/service_spec.rb
pact_broker-2.73.0 spec/lib/pact_broker/metrics/service_spec.rb
pact_broker-2.72.0 spec/lib/pact_broker/metrics/service_spec.rb