Pergunta

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??

Foi útil?

Solução

You probably want to use an erlang mocking library to mock out gen_fsm.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top