# `PactEx.Pact`
[🔗](https://github.com/arctarus/pact_ex/blob/v0.1.0/lib/pact_ex/pact.ex#L1)

A pact between one consumer and one provider.

Build it with `PactEx.new/3`.

# `spec`

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

# `t`

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

# `new`

```elixir
@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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
