View Source PactElixir.Dsl (PactElixir v0.5.2-rc.8)

This module can be imported to create and start a mock server with the usual Pact DSL.

Link to this section Summary

Functions

Verifies interactions and shuts the mock server down. To be called after test suite run in main application, eg. in an on_exit callback: on_exit(fn -> after_test_suite(provider) end)

Returns URL of the mock server host, eg. "http://localhost:54321"

Link to this section Functions

Link to this function

add_interaction(provider, description, given, request, response)

View Source

Adds an interaction to the pact.

Link to this function

after_test_suite(provider_pid)

View Source

Specs

after_test_suite(pid() | String.t()) :: :ok | :error

Verifies interactions and shuts the mock server down. To be called after test suite run in main application, eg. in an on_exit callback: on_exit(fn -> after_test_suite(provider) end)

Link to this function

mock_server_host_url(provider)

View Source

Returns URL of the mock server host, eg. "http://localhost:54321"

Link to this function

mock_server_matched?(provider)

View Source
Link to this function

mock_server_mismatches(provider)

View Source
Link to this function

service_provider(options \\ %{})

View Source
Link to this function

shut_down_mock_server(provider_pid)

View Source

Specs

shut_down_mock_server(pid()) :: :ok | :error
Link to this function

verify_interactions(provider_pid)

View Source

Specs

verify_interactions(pid()) :: :ok
Link to this function

will_respond_with(options)

View Source