From 4e7f272b3f351c2d43a34c85787e3a56aa7c01fa Mon Sep 17 00:00:00 2001 From: Alex Bramley Date: Mon, 22 Aug 2011 23:23:29 +0100 Subject: [PATCH] Mock dispatcher for testing. --- client/connection_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/connection_test.go b/client/connection_test.go index 9f04114..03efd05 100644 --- a/client/connection_test.go +++ b/client/connection_test.go @@ -10,3 +10,10 @@ func setUp(t *testing.T) (*mockNetConn, *Conn) { c.postConnect() return m, c } + +// Mock dispatcher to verify that events are triggered successfully +type mockDispatcher func(string, ...interface{}) + +func (d mockDispatcher) Dispatch(name string, ev ...interface{}) { + d(name, ev...) +}