@@ -9,19 +9,16 @@ import (
99 "github.com/charmbracelet/lipgloss"
1010)
1111
12- // build a Private Message
13- // call callback function pasisng in pm
14- type irc struct {
12+ type mockIrc struct {
1513 callback func(types.PrivateMessage)
1614}
1715
18- // pass in the callback function
19- func (i *irc) OnPrivateMessage(f func(types.PrivateMessage)) error {
16+ func (i *mockIrc) OnPrivateMessage(f func(types.PrivateMessage)) error {
2017 i.callback = f
2118 return nil
2219}
2320
24- func (i *irc ) Publish(string, string) error { return nil }
21+ func (i *mockIrc ) Publish(string, string) error { return nil }
2522
2623func TestIncomingMessages(t *testing.T) {
2724 tests := []struct {
@@ -86,7 +83,7 @@ func TestIncomingMessages(t *testing.T) {
8683
8784 for _, test := range tests {
8885 t.Run(test.Name, func(t *testing.T) {
89- incomingIRC := &irc {}
86+ incomingIRC := &mockIrc {}
9087 i := NewTwitch(incomingIRC, log.Default(), test.userDisplayName, "testChannel")
9188
9289 s := i.IncomingMessages()
@@ -124,7 +121,7 @@ func TestPublish(t *testing.T) {
124121
125122 for _, test := range tests {
126123 t.Run(test.Name, func(t *testing.T) {
127- incomingIRC := &irc {}
124+ incomingIRC := &mockIrc {}
128125 i := NewTwitch(incomingIRC, log.Default(), test.name, "testChannel")
129126
130127 s := i.IncomingMessages()
0 commit comments