Reputation: 21157
I am trying to write eunit tests to check wether a module send messages as it should. I can pass a PID as parameter so that it sends the messages to the testing module. The problem is that it sends messages using gen_fsm:send_event
.
I have tried implementing the gen_fsm
behaviour with the testing module and forward incomming messages to the testing functions. However, it does not work, the messages seem to get lost.
Anyone knows how to test for incoming gen_fsm
messages with eunit??
Upvotes: 0
Views: 252
Reputation: 5327
You probably want to use an erlang mocking library to mock out gen_fsm.
Upvotes: 2