(t *testing.T)
| 121 | } |
| 122 | |
| 123 | func TestCheckForUpdate_APIError(t *testing.T) { |
| 124 | srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 125 | w.WriteHeader(http.StatusInternalServerError) |
| 126 | })) |
| 127 | defer srv.Close() |
| 128 | |
| 129 | _, err := CheckForUpdate("0.5.0", Options{ReleasesURL: srv.URL}) |
| 130 | if err == nil { |
| 131 | t.Error("expected error for API failure") |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | func TestCheckForUpdate_BadJSON(t *testing.T) { |
| 136 | srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
nothing calls this directly
no test coverage detected