# `BB.Camera.V4L.Test.StubBackend`
[🔗](https://github.com/beam-bots/bb_camera_v4l/blob/main/test/support/stub_backend.ex#L5)

A capture backend the test drives byte by byte.

Stands in for ffmpeg so that every event capture has to cope with — a frame
split across reads, a truncated image, an unexpected exit status, a consumer
falling behind — is a function call in the test rather than something to wait
for and hope for.

Every operation is synchronous. `feed/2` returns once the data message is in
the capture's mailbox, so a test can feed bytes and then assert on what came
out without a sleep anywhere in between.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `exited`

```elixir
@spec exited(pid(), integer()) :: :ok
```

Report that the captured process exited with `status`.

# `feed`

```elixir
@spec feed(pid(), binary()) :: :ok
```

Deliver `data` to the capture as one read.

# `feed_all`

```elixir
@spec feed_all(pid(), [binary()]) :: :ok
```

Deliver each binary in turn as a separate read.

---

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