Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface {
URL() string // URl retrieves the URL to connect to.
Start() // Start attempts to start the server
Close() // Close attempts to close the server
Expect(path string, method string) Expectation // Expect adds a new expectation to the stack.
AllExpectationsMet() error // AllExpectationsMet reports whether all expectations have been met or used.
}
API represents a mock API.
func NewMockAPI ¶
NewMockAPI initialises a new mock api using the supplied encoder for the body.
type Expectation ¶
type Expectation interface {
WithStatusCode(code int) // WithStatusCode sets the status code for an expectation.
WithResult(code int, body interface{}) // WithResult sets the status code and result body for an expectation.
}
Expectation represents a met expectation. Effectively the result of matching a path and HTTP method.
Click to show internal directories.
Click to hide internal directories.