Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertError ¶
func AssertError(t *testing.T, resp *httptest.ResponseRecorder) (err error)
AssertError will assert error
Example ¶
t := &testing.T{}
recorder := httptest.NewRecorder()
request, err := http.NewRequest("POST", "http://here.com/v1/signin", nil)
if err != nil {
panic(err)
}
response.InternalServerError(request, recorder, errors.New("Failed to do something"))
AssertError(t, recorder)
func AssertErrorMessage ¶
AssertErrorMessage will assert error message
Example ¶
t := &testing.T{}
recorder := httptest.NewRecorder()
request, err := http.NewRequest("POST", "http://here.com/v1/signin", nil)
if err != nil {
panic(err)
}
response.InternalServerError(request, recorder, errors.New("Failed to do something"))
AssertErrorMessage(t, recorder, "Failed to do something")
Types ¶
This section is empty.
Source Files
¶
- assert.go
Click to show internal directories.
Click to hide internal directories.