-
Notifications
You must be signed in to change notification settings - Fork 217
Creating pacts
Beth Skurrie edited this page Apr 7, 2019
·
14 revisions
Follow the instructions in the README, this is the default behaviour.
Pact.service_consumer "consumer name" do
has_pact_with "provider name" do
mock_service :provider_name do
port 1234
host "..." # Optional, defaults to "localhost". Useful when using a standalone mock service.
standalone false # Optional. If true, does not automatically start a mock service
# You must start/stop the mock service manually.
end
end
end
Configure your Rack application to be started by Pact, and tell it what port to run on.
Pact.service_consumer "My Consumer" do
app your_rack_app
port 8001
has_pact_with "My Provider" do
...
end
end