(t *testing.T)
| 39 | } |
| 40 | |
| 41 | func TestCheckForUpdate_AlreadyLatest(t *testing.T) { |
| 42 | release := Release{TagName: "v0.5.0"} |
| 43 | srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 44 | json.NewEncoder(w).Encode(release) |
| 45 | })) |
| 46 | defer srv.Close() |
| 47 | |
| 48 | result, err := CheckForUpdate("v0.5.0", Options{ReleasesURL: srv.URL}) |
| 49 | if err != nil { |
| 50 | t.Fatalf("unexpected error: %v", err) |
| 51 | } |
| 52 | if result.UpdateAvailable { |
| 53 | t.Error("expected no update available") |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | func TestCheckForUpdate_DevVersion(t *testing.T) { |
| 58 | release := Release{TagName: "v1.0.0"} |
nothing calls this directly
no test coverage detected