mirror of https://github.com/fluffle/goirc
Call init in connect so theres no special casing for tests.
This commit is contained in:
parent
8e16f59b5f
commit
ed85f957b5
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue