Sha256: face1238ca282fc1e70ab8000cec352a8712d60d03f5e4abedc40d3945a62c98

Contents?: true

Size: 1.02 KB

Versions: 26

Compression:

Stored size: 1.02 KB

Contents

require 'json'

module Pact
  module Provider
    module VerificationResults
      class VerificationResult

        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

        private

        attr_reader :success, :provider_application_version, :test_results_hash
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
pact-1.46.1 lib/pact/provider/verification_results/verification_result.rb
pact-1.46.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.45.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.44.1 lib/pact/provider/verification_results/verification_result.rb
pact-1.44.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.43.1 lib/pact/provider/verification_results/verification_result.rb
pact-1.43.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.42.3 lib/pact/provider/verification_results/verification_result.rb
pact-1.42.2 lib/pact/provider/verification_results/verification_result.rb
pact-1.42.1 lib/pact/provider/verification_results/verification_result.rb
pact-1.42.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.41.2 lib/pact/provider/verification_results/verification_result.rb
pact-1.41.1 lib/pact/provider/verification_results/verification_result.rb
pact-1.41.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.40.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.39.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.38.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.37.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.36.2 lib/pact/provider/verification_results/verification_result.rb
pact-1.36.0 lib/pact/provider/verification_results/verification_result.rb