Sha256: a81991d559a1840fda903b20aacf00e6c997f83c6f2030f3312faec8e99700c6

Contents?: true

Size: 1.01 KB

Versions: 10

Compression:

Stored size: 1.01 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
          {
            success: success,
            providerApplicationVersion: provider_application_version,
            #testResults: test_results_hash # not yet
          }.to_json
        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

10 entries across 10 versions & 1 rubygems

Version Path
pact-1.26.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.25.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.24.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.23.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.22.2 lib/pact/provider/verification_results/verification_result.rb
pact-1.22.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.21.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.20.1 lib/pact/provider/verification_results/verification_result.rb
pact-1.20.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.19.2 lib/pact/provider/verification_results/verification_result.rb