From ed85f957b53c71fb8eda74025eb648679779a3c5 Mon Sep 17 00:00:00 2001 From: Chris Rhodes Date: Fri, 15 Feb 2013 19:47:10 -0800 Subject: [PATCH] Call init in connect so theres no special casing for tests. --- client/connection.go | 2 +- client/connection_test.go | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/client/connection.go b/client/connection.go index e1128a2..1cd0ece 100644 --- a/client/connection.go +++ b/client/connection.go @@ -171,6 +171,7 @@ func (conn *Conn) Connect(host string, pass ...string) error { conn.password = "" } conn.postConnect() + conn.dispatch(&Line{Cmd: INIT}) return nil } @@ -188,7 +189,6 @@ func (conn *Conn) postConnect() { go func() { <-conn.cPing }() } go conn.runLoop() - conn.dispatch(&Line{Cmd: INIT}) } // copied from http.client for great justice diff --git a/client/connection_test.go b/client/connection_test.go index e4d09ba..f03dc4e 100644 --- a/client/connection_test.go +++ b/client/connection_test.go @@ -33,9 +33,6 @@ func setUp(t *testing.T, start ...bool) (*Conn, *testState) { // Hack to allow tests of send, recv, write etc. // NOTE: the value of the boolean doesn't matter. c.postConnect() - // All connections start with NICK/USER expect these. - nc.Expect("NICK test") - nc.Expect("USER test 12 * :Testing IRC") // Sleep 1ms to allow background routines to start. <-time.After(1e6)