# `MutagenEx.Test.CaptureIoFacade`
[🔗](https://github.com/iautom8things/mutagen_ex/blob/v0.2.0/lib/mutagen_ex/test/capture_io_facade.ex#L1)

Behaviour for the `ExUnit.CaptureIO` test seam used by
`MutagenEx.MutationRunner` (around the swap-compile call) and
`MutagenEx.MutationRunner.MutationLoop` (around the per-site test
run, to absorb compiler warnings and any other stderr emitted during
the mutation cycle).

Production code uses `ExUnit.CaptureIO.with_io/3`'s 2-arity form via
this facade so call sites can compile-time-dispatch against a
behaviour rather than `apply/3` an arbitrary module reference.

## Default

`MutagenEx.Test.CaptureIo` delegates to `ExUnit.CaptureIO`.

# `device`

```elixir
@type device() :: atom() | pid()
```

Device atom or pid accepted by ExUnit.CaptureIO.with_io/2.

# `with_io`

```elixir
@callback with_io(device :: device(), fun :: (-&gt; any())) :: {any(), binary()}
```

Run `fun` while capturing IO written to `device`. Mirrors
`ExUnit.CaptureIO.with_io/2`.

Returns `{closure_result, captured_io_binary}`.

---

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