ysbaddaden/sinapse — pull request #10 by ysbaddaden (2014-05-19 08:56:20+00:00)
Title: Catch published messages in testing (minitest)

Example with Minitest Unit:

```ruby
require "sinapse/testing"

class RoomTest < Minitest::Test
include Sinapse::TestHelper

def setup
Sinapse::Testing.enable!
Sinapse.messages.clear!
end

def teardown
Sinapse::Testing.disable!
end

def test_publishes_message
assert_publishes(1) { rooms(:main).publish("message", event: "event") }
assert_equal "event", Sinapse.messages.last[:event]
assert_equal "message", Sinapse.messages.last[:message]
end
end
```