Sha256: d9cdfa3d32012329b9513fede76b3fb0c4f25872ab28251caa0bd12720f134e4

Contents?: true

Size: 1.03 KB

Versions: 5

Compression:

Stored size: 1.03 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 # not yet
          }.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

5 entries across 5 versions & 1 rubygems

Version Path
pact-1.30.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.29.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.28.0 lib/pact/provider/verification_results/verification_result.rb
pact-1.28.0.rc1 lib/pact/provider/verification_results/verification_result.rb
pact-1.27.0 lib/pact/provider/verification_results/verification_result.rb