How can I test a function that has been called

Providing some links:

Something like Publit.PubSub.subscribe(topic) then assert_receive later should be enough, no mock involved.