On 7/10/07, Chris Carter <cdcarter at gmail.com>
wrote:> I needed a good way to test my EM server modules, so I threw this together:
> http://pastie.caboo.se/77652.
>
> The only code that is really specific to my server is anything related
> to $STORE (namly, a delete of that file), and everything else is
> pretty agnostic. It gives you a @connection object that will have all
> the methods of your module mixed in, send_data will log for within
> that test, and send_data will return exactly what was passed to it,
> so, if the last line of your receive_data is a send_data, then
> receive_data will return what was sent.
>
I use mocha for testing EM apps and it works great.