Created
December 25, 2018 17:25
-
-
Save aurimasbachanovicius/1ca583a2d433b7f5c7e19d83595c259b to your computer and use it in GitHub Desktop.
golang simple response test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func simpleTestResponse(t *testing.T, want string, url string, method string) { | |
request, _ := http.NewRequest(method, url, nil) | |
response := httptest.NewRecorder() | |
PlayerServer(response, request) | |
got := response.Body.String() | |
if got != want { | |
t.Errorf("got '%s', want '%s'", got, want) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment