# `Spek.Check`
[🔗](https://github.com/woylie/spek/blob/0.2.0/lib/spek/check.ex#L1)

Struct that represents the evaluation result of a single check function.

# `args`

```elixir
@type args() :: [{:ctx, atom()} | :ctx | term()]
```

Defines the arguments passed to the check function.

If the list is empty, the function will be called without arguments.

The list value `:ctx` is substituted with the evaluation context passed to
the evaluation functions.

The list value `{:ctx, atom}` is substituted with the value at the given key
in the evaluation context.

# `t`

```elixir
@type t() :: %Spek.Check{
  args: args(),
  fun: atom(),
  module: module(),
  result: Spek.result() | nil,
  satisfied?: boolean() | nil
}
```

Representation of a single policy check.

- `module`, `fun`, `args` - Module, function, and arguments for the check
  function to run. To reference a key in the context argument passed to the
  `eval` functions, use `{:ctx, atom}`. To pass the whole context as an
  argument, use `:ctx`.
- `result` - The original return value of the check function.
- `satisfied?` - A boolean set depending on the return value of the check
  function.

`result` and `satisfied?` are only set when the expression is evaluated.

The `result` values `true`, `:ok`, and `{:ok, term}` are mapped to
`satisfied?: true`. The result values `false`, `:error`, and `{:error, term}`
are mapped to `satisfied?: false`.

---

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