Documentation ¶
Overview ¶
Package httptest wraps the standard library's httptest.ResponseRecorder in order to fail any test doing superfluous response.WriteHeader calls.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WrappedResponseRecorder ¶
type WrappedResponseRecorder struct { *stdhttptest.ResponseRecorder // contains filtered or unexported fields }
WrappedResponseRecorder wraps httptest.ResponseRecorder in order to fail tests doing superfluous WriteHeader calls.
func NewRecorder ¶
func NewRecorder() *WrappedResponseRecorder
NewRecorder returns a new test response recorder detecting superfluous WriteHeader calls.
func (*WrappedResponseRecorder) WriteHeader ¶
func (w *WrappedResponseRecorder) WriteHeader(code int)
WriteHeader implements http.ResponseWriter, failing tests that do superfluous WriteHeader calls.
Click to show internal directories.
Click to hide internal directories.