1
0
Fork 0
mirror of https://github.com/fluffle/goirc synced 2025-05-15 12:03:21 +00:00

Update client for new state tracking code.

This commit is contained in:
Alex Bramley 2015-01-02 12:58:50 +00:00
parent d11d209dcd
commit 0216e0406e
5 changed files with 158 additions and 220 deletions

View file

@ -128,20 +128,23 @@ func TestClientAndStateTracking(t *testing.T) {
}
// We're expecting the untracked me to be replaced by a tracked one
if c.st == nil {
t.Errorf("State tracker not enabled correctly.")
}
if me := c.cfg.Me; me.Nick != "test" || me.Ident != "test" ||
me.Name != "Testing IRC" || me.Host != "" {
t.Errorf("Enabling state tracking did not replace Me correctly.")
}
if c.st == nil || c.cfg.Me != c.st.Me() {
t.Errorf("State tracker not enabled correctly.")
}
// Now, shim in the mock state tracker and test disabling state tracking
me := c.cfg.Me
c.st = st
st.EXPECT().Wipe()
gomock.InOrder(
st.EXPECT().Me().Return(me),
st.EXPECT().Wipe(),
)
c.DisableStateTracking()
if c.st != nil || c.cfg.Me != me {
if c.st != nil || !c.cfg.Me.Equals(me) {
t.Errorf("State tracker not disabled correctly.")
}