Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestClientServer ¶
type TestClientServer struct {
// contains filtered or unexported fields
}
TestClientServer is a simple abstraction meant to be used as an io.ReadWriter with seabird.Bot so messages can be tracked.
func NewTestClientServer ¶
func NewTestClientServer() *TestClientServer
NewTestClientServer returns a new TestClientServer.
func (*TestClientServer) CheckLines ¶
func (cs *TestClientServer) CheckLines(t *testing.T, expected []string) bool
CheckLines will ensure that the client sent all the expected lines (and nothing more) and return true if they did and false if they didn't.
func (*TestClientServer) Read ¶
func (cs *TestClientServer) Read(p []byte) (int, error)
Read is what will be coming from the "server".
func (*TestClientServer) Reset ¶
func (cs *TestClientServer) Reset()
Reset clears the contents of the internal buffers.
func (*TestClientServer) SendServerLines ¶
func (cs *TestClientServer) SendServerLines(lines []string)
SendServerLines will send all given irc.Messages as if they were coming from the server, to be read by the test client.
type TestHandler ¶
type TestHandler struct {
// contains filtered or unexported fields
}
TestHandler is meant to be inserted as a Handler somewhere to capture all messages which are sent.
func (*TestHandler) Handle ¶
func (th *TestHandler) Handle(ctx context.Context, m *irc.Message)
Handle implements the Handler interface.
func (*TestHandler) PopMessages ¶
func (th *TestHandler) PopMessages() []*irc.Message
PopMessages will return all the messages that were passed to this handler.