Last active
August 29, 2015 14:17
-
-
Save quii/6520d1eb85574d814bb3 to your computer and use it in GitHub Desktop.
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 Test_it_handles_non_ok_from_hello_api(t *testing.T) { | |
helloAPI := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |
http.Error(w, "oops", http.StatusInternalServerError) | |
})) | |
worldAPI := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprint(w, "world") | |
})) | |
result := Stitcher(helloAPI.URL, worldAPI.URL) | |
if result != errorMsg { | |
t.Errorf("Stitcher didnt fail properly, expected [%s], got [%s]", errorMsg, result) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment