DanKnox/websocket-rails — pull request #42 by nessche (2013-01-30 14:43:24+00:00)
Title: Improved spec helpers

I added one helper class and a few matchers to be able to spec controllers derived from `WebsocketRails::BaseController` and to verify the correct routing of events.

* class `SpecHelperEvent` derives from `Event` adding to it the capability of setting up the eventmap and the dispatcher internally and using them to route itself to the correct controller. Also it overrides the `trigger` such that it no longer invokes the underlying connection object, but simply records the trigger invocation, allowing further checks regarding whether or not the event received the `trigger` call

* there are two groups of custom matchers:
* routing matchers check that the correct controller is associated with a given event.
* trigger matchers check whether or not a controller triggers success/failure messages back to the caller and ensuring that the data associated with the trigger message is as expected.

Examples of the use of the new class and matchers can be found in

spec/unit/route_matchers_spec.rb
spec/unit/trigger_matchers_spec.rb