module Pact
@public Used by Pact
Provider
Verifier
TODO move this to the pact broker client
To create a rake pact:verify:<something> task
Pact::VerificationTask.new
(:head) do | pact |
pact.uri 'http://master.cd.vpc.realestate.com.au/browse/BIQ-MAS/latestSuccessful/artifact/JOB2/Pacts/mas-contract_transaction_service.json' pact.uri 'http://master.cd.vpc.realestate.com.au/browse/BIQ-IMAGINARY-CONSUMER/latestSuccessful/artifact/JOB2/Pacts/imaginary_consumer-contract_transaction_service.json'
end
The pact.uri may be a local file system path or a remote URL.
To run a pact:verify:xxx task you need to define a pact_helper.rb, ideally in spec/service_consumers. It should contain your service_provider definition, and load any provider state definition files. It should also load all your app’s dependencies (eg by calling out to spec_helper)
Eg.
require ‘spec_helper’ require ‘provider_states_for_my_consumer’
Pact.service_provider “My Provider” do
app { TestApp.new }
end
Can’t use refinements because of Travelling Ruby
Remember to bump pact-provider-proxy when this changes major version
Constants
- VERSION
Public Class Methods
internal api, for testing only
# File lib/pact/consumer/world.rb, line 8 def self.clear_consumer_world @consumer_world = nil end
internal api, for testing only
# File lib/pact/provider/world.rb, line 10 def self.clear_provider_world @world = nil end
# File lib/pact/consumer/world.rb, line 3 def self.consumer_world @consumer_world ||= Pact::Consumer::World.new end
# File lib/pact/project_root.rb, line 4 def self.project_root @project_root ||= Pathname.new(File.expand_path('../../../',__FILE__)).freeze end
# File lib/pact/provider/world.rb, line 5 def self.provider_world @world ||= Pact::Provider::World.new end