Documentation
¶
Overview ¶
Package slacktest is a fake Slack Web API for tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Response ¶
Response lets a handler set the HTTP status and headers of its answer. A zero Status means 200.
type Server ¶
type Server struct {
// URL is the base URL to use as slack.Client.BaseURL.
URL string
// HTTP is the client to use as slack.Client.HTTP; nil reaches URL over the network.
HTTP *http.Client
// contains filtered or unexported fields
}
func New ¶
New starts a fake Slack closed when t ends. A method without a handler answers {"ok": false, "error": "unknown_method"}, as Slack does.
func NewInMemory ¶
func NewInMemory() *Server
NewInMemory is a fake Slack that HTTP serves in memory, without a socket, so a synctest bubble can call it.
func (*Server) Authorization ¶
Authorization returns the bearer token of every request received for method ("" when absent).
func (*Server) Calls ¶
Calls returns the form of every request received for method, rate-limited ones included.
func (*Server) Close ¶
func (s *Server) Close()
Close stops a networked server early, so calls fail at the transport.