httpmatchers: github.com/jcbwlkr/httpmatchers Index | Files

package httpmatchers

import "github.com/jcbwlkr/httpmatchers"

Package httpmatchers provides a set of custom matchers for github.com/onsi/gomega to use for testing responses from HTTP server handlers.

Specifically it allows you to replace code like this

Expect(w.Code).To(Equal(http.StatusOK), "HTTP Status should be OK")

Which yields an error message like

HTTP Status should be OK
Expected
	<int>: 400
to equal
	<int>: 200

With this code

Expect(w.Code).To(BeHTTPStatusOK())

Which yields an error message like this

Expected
	<string>: HTTP status 400 Bad Request
to be
	<string>: HTTP status 200 OK

Index

Package Files

doc.go implementation.go matchers.go

func BeHTTPStatusAccepted Uses

func BeHTTPStatusAccepted() types.GomegaMatcher

BeHTTPStatusAccepted matches the HTTP status code 202 Accepted

func BeHTTPStatusBadGateway Uses

func BeHTTPStatusBadGateway() types.GomegaMatcher

BeHTTPStatusBadGateway matches the HTTP status code 502 Bad Gateway

func BeHTTPStatusBadRequest Uses

func BeHTTPStatusBadRequest() types.GomegaMatcher

BeHTTPStatusBadRequest matches the HTTP status code 400 Bad Request

func BeHTTPStatusConflict Uses

func BeHTTPStatusConflict() types.GomegaMatcher

BeHTTPStatusConflict matches the HTTP status code 409 Conflict

func BeHTTPStatusContinue Uses

func BeHTTPStatusContinue() types.GomegaMatcher

BeHTTPStatusContinue matches the HTTP status code 100 Continue

func BeHTTPStatusCreated Uses

func BeHTTPStatusCreated() types.GomegaMatcher

BeHTTPStatusCreated matches the HTTP status code 201 Created

func BeHTTPStatusExpectationFailed Uses

func BeHTTPStatusExpectationFailed() types.GomegaMatcher

BeHTTPStatusExpectationFailed matches the HTTP status code 417 Expectation Failed

func BeHTTPStatusForbidden Uses

func BeHTTPStatusForbidden() types.GomegaMatcher

BeHTTPStatusForbidden matches the HTTP status code 403 Forbidden

func BeHTTPStatusFound Uses

func BeHTTPStatusFound() types.GomegaMatcher

BeHTTPStatusFound matches the HTTP status code 302 Found

func BeHTTPStatusGatewayTimeout Uses

func BeHTTPStatusGatewayTimeout() types.GomegaMatcher

BeHTTPStatusGatewayTimeout matches the HTTP status code 504 Gateway Timeout

func BeHTTPStatusGone Uses

func BeHTTPStatusGone() types.GomegaMatcher

BeHTTPStatusGone matches the HTTP status code 410 Gone

func BeHTTPStatusHTTPVersionNotSupported Uses

func BeHTTPStatusHTTPVersionNotSupported() types.GomegaMatcher

BeHTTPStatusHTTPVersionNotSupported matches the HTTP status code 505 HTTP Version Not Supported

func BeHTTPStatusInternalServerError Uses

func BeHTTPStatusInternalServerError() types.GomegaMatcher

BeHTTPStatusInternalServerError matches the HTTP status code 500 Internal Server Error

func BeHTTPStatusLengthRequired Uses

func BeHTTPStatusLengthRequired() types.GomegaMatcher

BeHTTPStatusLengthRequired matches the HTTP status code 411 Length Required

func BeHTTPStatusMethodNotAllowed Uses

func BeHTTPStatusMethodNotAllowed() types.GomegaMatcher

BeHTTPStatusMethodNotAllowed matches the HTTP status code 405 Method Not Allowed

func BeHTTPStatusMovedPermanently Uses

func BeHTTPStatusMovedPermanently() types.GomegaMatcher

BeHTTPStatusMovedPermanently matches the HTTP status code 301 Moved Permanently

func BeHTTPStatusMultipleChoices Uses

func BeHTTPStatusMultipleChoices() types.GomegaMatcher

BeHTTPStatusMultipleChoices matches the HTTP status code 300 Multiple Choices

func BeHTTPStatusNoContent Uses

func BeHTTPStatusNoContent() types.GomegaMatcher

BeHTTPStatusNoContent matches the HTTP status code 204 No Content

func BeHTTPStatusNonAuthoritativeInfo Uses

func BeHTTPStatusNonAuthoritativeInfo() types.GomegaMatcher

BeHTTPStatusNonAuthoritativeInfo matches the HTTP status code 203 Non Authoritative Info

func BeHTTPStatusNotAcceptable Uses

func BeHTTPStatusNotAcceptable() types.GomegaMatcher

BeHTTPStatusNotAcceptable matches the HTTP status code 406 Not Acceptable

func BeHTTPStatusNotFound Uses

func BeHTTPStatusNotFound() types.GomegaMatcher

BeHTTPStatusNotFound matches the HTTP status code 404 Not Found

func BeHTTPStatusNotImplemented Uses

func BeHTTPStatusNotImplemented() types.GomegaMatcher

BeHTTPStatusNotImplemented matches the HTTP status code 501 Not Implemented

func BeHTTPStatusNotModified Uses

func BeHTTPStatusNotModified() types.GomegaMatcher

BeHTTPStatusNotModified matches the HTTP status code 304 Not Modified

func BeHTTPStatusOK Uses

func BeHTTPStatusOK() types.GomegaMatcher

BeHTTPStatusOK matches the HTTP status code 200 OK

func BeHTTPStatusPartialContent Uses

func BeHTTPStatusPartialContent() types.GomegaMatcher

BeHTTPStatusPartialContent matches the HTTP status code 206 Partial Content

func BeHTTPStatusPaymentRequired Uses

func BeHTTPStatusPaymentRequired() types.GomegaMatcher

BeHTTPStatusPaymentRequired matches the HTTP status code 402 Payment Required

func BeHTTPStatusPreconditionFailed Uses

func BeHTTPStatusPreconditionFailed() types.GomegaMatcher

BeHTTPStatusPreconditionFailed matches the HTTP status code 412 Precondition Failed

func BeHTTPStatusProxyAuthRequired Uses

func BeHTTPStatusProxyAuthRequired() types.GomegaMatcher

BeHTTPStatusProxyAuthRequired matches the HTTP status code 407 Proxy Auth Required

func BeHTTPStatusRequestEntityTooLarge Uses

func BeHTTPStatusRequestEntityTooLarge() types.GomegaMatcher

BeHTTPStatusRequestEntityTooLarge matches the HTTP status code 413 Request Entity Too Large

func BeHTTPStatusRequestTimeout Uses

func BeHTTPStatusRequestTimeout() types.GomegaMatcher

BeHTTPStatusRequestTimeout matches the HTTP status code 408 Request Timeout

func BeHTTPStatusRequestURITooLong Uses

func BeHTTPStatusRequestURITooLong() types.GomegaMatcher

BeHTTPStatusRequestURITooLong matches the HTTP status code 414 Request URIToo Long

func BeHTTPStatusRequestedRangeNotSatisfiable Uses

func BeHTTPStatusRequestedRangeNotSatisfiable() types.GomegaMatcher

BeHTTPStatusRequestedRangeNotSatisfiable matches the HTTP status code 416 Requested Range Not Satisfiable

func BeHTTPStatusResetContent Uses

func BeHTTPStatusResetContent() types.GomegaMatcher

BeHTTPStatusResetContent matches the HTTP status code 205 Reset Content

func BeHTTPStatusSeeOther Uses

func BeHTTPStatusSeeOther() types.GomegaMatcher

BeHTTPStatusSeeOther matches the HTTP status code 303 See Other

func BeHTTPStatusServiceUnavailable Uses

func BeHTTPStatusServiceUnavailable() types.GomegaMatcher

BeHTTPStatusServiceUnavailable matches the HTTP status code 503 Service Unavailable

func BeHTTPStatusSwitchingProtocols Uses

func BeHTTPStatusSwitchingProtocols() types.GomegaMatcher

BeHTTPStatusSwitchingProtocols matches the HTTP status code 101 Switching Protocols

func BeHTTPStatusTeapot Uses

func BeHTTPStatusTeapot() types.GomegaMatcher

BeHTTPStatusTeapot matches the HTTP status code 418 Teapot

func BeHTTPStatusTemporaryRedirect Uses

func BeHTTPStatusTemporaryRedirect() types.GomegaMatcher

BeHTTPStatusTemporaryRedirect matches the HTTP status code 307 Temporary Redirect

func BeHTTPStatusUnauthorized Uses

func BeHTTPStatusUnauthorized() types.GomegaMatcher

BeHTTPStatusUnauthorized matches the HTTP status code 401 Unauthorized

func BeHTTPStatusUnsupportedMediaType Uses

func BeHTTPStatusUnsupportedMediaType() types.GomegaMatcher

BeHTTPStatusUnsupportedMediaType matches the HTTP status code 415 Unsupported Media Type

func BeHTTPStatusUseProxy Uses

func BeHTTPStatusUseProxy() types.GomegaMatcher

BeHTTPStatusUseProxy matches the HTTP status code 305 Use Proxy

Package httpmatchers imports 4 packages (graph). Updated 2016-07-29. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).