View Source pact (pact_erlang v0.2.1)

Summary

Functions

Stops pact server
Creates a mock server with the given interaction details Returns its port for running pact consumer tests
Starts a new pact server and returns its pid Returns old instance's pid in case cleanup was not done correctly
Verifies Writes pact file and also finally cleanups
writes pact to the default directory path ./pacts
writes pact to the given directory path

Types

-type consumer() :: binary().
Link to this type

pact_interaction_details/0

View Source
-type pact_interaction_details() :: map().
Link to this type

pact_mock_server_port/0

View Source
-type pact_mock_server_port() :: integer().
-type pact_pid() :: pid().
-type provider() :: binary().

Functions

-spec cleanup(pact_pid()) -> ok.
Stops pact server
Link to this function

interaction(PactPid, Interaction)

View Source
-spec interaction(pact_pid(), pact_interaction_details()) -> {ok, pact_mock_server_port()}.
Creates a mock server with the given interaction details Returns its port for running pact consumer tests
-spec v4(consumer(), provider()) -> pact_pid().
Starts a new pact server and returns its pid Returns old instance's pid in case cleanup was not done correctly
-spec verify(pact_pid()) -> {ok, matched} | {error, not_matched}.
Verifies Writes pact file and also finally cleanups
-spec write(pact_pid()) -> ok.
writes pact to the default directory path ./pacts
-spec write(pact_pid(), binary()) -> ok.
writes pact to the given directory path