Documentation ¶
Overview ¶
Testing related to the http package
Index ¶
- func AllowedMethodsShouldBe(response fmt.Stringer, methods ...string) func()
- func ShouldAllowMethods(response fmt.Stringer, methods ...string) func()
- func ShouldHaveNoBody(response fmt.Stringer, status int, reason string) func()
- func ShouldNotAllowMethod(response fmt.Stringer, method string) func()
- type RequestMessage
- func (message *RequestMessage) AddHeader(field string, value string)
- func (message *RequestMessage) AddQueryParameter(name string, value string)
- func (message *RequestMessage) Body() []byte
- func (message *RequestMessage) HeaderLines() []string
- func (message *RequestMessage) HeaderValues(field string) (values []string)
- func (message *RequestMessage) MakeResourceRequest(resource http.Resource) http.Request
- func (message *RequestMessage) MakeResourceRequestShouldHaveReceived(resource http.Resource)
- func (message *RequestMessage) Method() string
- func (message *RequestMessage) Path() string
- func (message *RequestMessage) QueryParameters() []http.QueryParameter
- func (message *RequestMessage) SetStringBody(body string)
- func (message *RequestMessage) Target() string
- func (message *RequestMessage) Version() string
- type RequestMock
- type ResponseMessage
- func (message *ResponseMessage) BodyShould(matcher types.GomegaMatcher)
- func (message ResponseMessage) HeaderAsInt(name string) (int, error)
- func (message *ResponseMessage) HeaderShould(name string, match types.GomegaMatcher)
- func (message *ResponseMessage) HeaderShouldNot(name string, doNotMatch types.GomegaMatcher)
- func (message *ResponseMessage) HeaderValue(name string) string
- func (message *ResponseMessage) ShouldBeWellFormed()
- func (message *ResponseMessage) StatusShouldBe(status int, reason string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowedMethodsShouldBe ¶
func ShouldAllowMethods ¶
func ShouldHaveNoBody ¶
func ShouldNotAllowMethod ¶
Types ¶
type RequestMessage ¶
type RequestMessage struct { MethodReturns string PathReturns string TargetReturns string VersionReturns string MakeResourceRequestReturns http.Request // contains filtered or unexported fields }
func (*RequestMessage) AddHeader ¶
func (message *RequestMessage) AddHeader(field string, value string)
func (*RequestMessage) AddQueryParameter ¶
func (message *RequestMessage) AddQueryParameter(name string, value string)
func (*RequestMessage) Body ¶
func (message *RequestMessage) Body() []byte
func (*RequestMessage) HeaderLines ¶
func (message *RequestMessage) HeaderLines() []string
func (*RequestMessage) HeaderValues ¶
func (message *RequestMessage) HeaderValues(field string) (values []string)
func (*RequestMessage) MakeResourceRequest ¶
func (message *RequestMessage) MakeResourceRequest(resource http.Resource) http.Request
func (*RequestMessage) MakeResourceRequestShouldHaveReceived ¶
func (message *RequestMessage) MakeResourceRequestShouldHaveReceived(resource http.Resource)
func (*RequestMessage) Method ¶
func (message *RequestMessage) Method() string
func (*RequestMessage) Path ¶
func (message *RequestMessage) Path() string
func (*RequestMessage) QueryParameters ¶
func (message *RequestMessage) QueryParameters() []http.QueryParameter
func (*RequestMessage) SetStringBody ¶
func (message *RequestMessage) SetStringBody(body string)
func (*RequestMessage) Target ¶
func (message *RequestMessage) Target() string
func (*RequestMessage) Version ¶
func (message *RequestMessage) Version() string
type RequestMock ¶
type RequestMock struct { HandleReturns string // contains filtered or unexported fields }
func (*RequestMock) VerifyHandle ¶
func (mock *RequestMock) VerifyHandle(writer *bufio.Writer)
type ResponseMessage ¶
type ResponseMessage struct {
Text string
}
func ParseResponse ¶
func ParseResponse(text fmt.Stringer) *ResponseMessage
func (*ResponseMessage) BodyShould ¶
func (message *ResponseMessage) BodyShould(matcher types.GomegaMatcher)
func (ResponseMessage) HeaderAsInt ¶
func (message ResponseMessage) HeaderAsInt(name string) (int, error)
func (*ResponseMessage) HeaderShould ¶
func (message *ResponseMessage) HeaderShould(name string, match types.GomegaMatcher)
func (*ResponseMessage) HeaderShouldNot ¶
func (message *ResponseMessage) HeaderShouldNot(name string, doNotMatch types.GomegaMatcher)
func (*ResponseMessage) HeaderValue ¶
func (message *ResponseMessage) HeaderValue(name string) string
func (*ResponseMessage) ShouldBeWellFormed ¶
func (message *ResponseMessage) ShouldBeWellFormed()
func (*ResponseMessage) StatusShouldBe ¶
func (message *ResponseMessage) StatusShouldBe(status int, reason string)
Click to show internal directories.
Click to hide internal directories.