Sha256: d6442e7f05e868aa1e426c7a3cc8def62608a68abe933d30446aa1d3196c97f8

Contents?: true

Size: 1 KB

Versions: 28

Compression:

Stored size: 1 KB

Contents

require 'json'

module Pact
  module Provider
    module VerificationResults
      class VerificationResult
        attr_reader :success, :provider_application_version, :test_results_hash

        def initialize publishable, success, provider_application_version, test_results_hash
          @publishable = publishable
          @success = success
          @provider_application_version = provider_application_version
          @test_results_hash = test_results_hash
        end

        def publishable?
          @publishable
        end

        def provider_application_version_set?
          !!provider_application_version
        end

        def to_json(options = {})
          {
            success: success,
            providerApplicationVersion: provider_application_version,
            testResults: test_results_hash
          }.to_json(options)
        end

        def to_s
          "[success: #{success}, providerApplicationVersion: #{provider_application_version}]"
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
pact-1.62.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.61.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.60.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.59.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.58.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.57.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.56.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.55.7 lib/pact/provider/verification_results/verification_result.rb
pact-1.55.6 lib/pact/provider/verification_results/verification_result.rb
pact-1.55.5 lib/pact/provider/verification_results/verification_result.rb
pact-1.55.4 lib/pact/provider/verification_results/verification_result.rb
pact-1.55.3 lib/pact/provider/verification_results/verification_result.rb
pact-1.55.2 lib/pact/provider/verification_results/verification_result.rb
pact-1.55.1 lib/pact/provider/verification_results/verification_result.rb
pact-1.55.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.54.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.53.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.52.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.51.1 lib/pact/provider/verification_results/verification_result.rb
pact-1.51.0 lib/pact/provider/verification_results/verification_result.rb