celluloid/celluloid-zmq — pull request #32 by jnicklas (2014-01-30 10:00:03+00:00)
Title: Add basic specs

Closes #28

Sorry, this pull request is a bit of a mess.

I added a few basic specs which just check the most basic funcionality in the gem. It also provides a nice base on which to write more. These are more integration than unit tests, but I think that's what's most helpful here at this point. We might want to add some unit tests for critical components as well at some point. This is all happy path too, I'd like to be able to simulate failure conditions, but I have no idea how to do this with zeromq.

Additionally I changed some stuff. Sorry ;) I made `context` not lazily initialize the ZMQ context, since this is not threadsafe, and potentially problematic if the user forgets to call Celluloid::ZMQ.init. Instead it'll throw an exception if `init` hasn't been called.

I also made a small tweak to the waker which shuts it down properly when the mailbox goes down. This is necessary so that terminating the context doesn't hang indefinitely.