GenServers - how to test with `capture_io`?

if you can’t wait for elixir 1.17, you can manually set the group_leader of the pid you want using :erlang.group_leader/2 to your test process and assert_receive on the messages that flow in.

Be careful! The order of the parameters on :erlang.group_leader/2 might not be the order you expect.