PactEx.Pact (pact_ex v0.1.0)

Copy Markdown View Source

A pact between one consumer and one provider.

Build it with PactEx.new/3.

Summary

Functions

Creates a pact for consumer and provider.

Types

spec()

@type spec() :: :v2 | :v3 | :v4

t()

@type t() :: %PactEx.Pact{
  consumer: String.t(),
  pact_dir: Path.t(),
  provider: String.t(),
  spec: spec()
}

Functions

new(consumer, provider, opts \\ [])

@spec new(String.t(), String.t(), keyword()) :: t()

Creates a pact for consumer and provider.

Options

  • :spec - Pact specification, one of :v2, :v3 or :v4. Defaults to :v4.
  • :pact_dir - Directory where the pact file is written. Defaults to "pacts".

Raises ArgumentError on unknown options, an invalid :spec or a :pact_dir that is not a non-empty string. Raises FunctionClauseError if consumer or provider is not a string.