# `BB.Test.RecordingActuator`
[🔗](https://github.com/beam-bots/bb/blob/main/test/support/recording_actuator.ex#L5)

Actuator that forwards every received command message to a test process.

Before starting the robot, put the recipient pid into persistent term:

    :persistent_term.put({BB.Test.RecordingActuator, MyRobot}, self())

The actuator looks up the recipient at init and sends
`{:received, :command, message}` for each command, whichever transport
delivered it - a driver can't tell, and shouldn't need to.

It deliberately does not subscribe to its own command topic: the framework
owns that subscription, and a double that subscribed for itself would pass
the tests whether or not the framework did its job.

Pass `subscribe_to:` to have it subscribe to some other topic. Messages
arriving there are forwarded as `{:received, :info, message}`, which is how
the tests check that the server leaves a driver's own subscriptions alone.

Pass `delay_ms:` to have it block for that long before answering a command,
standing in for a driver that waits on slow hardware.

---

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