MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / TestCheckForUpdate_AlreadyLatest

Function TestCheckForUpdate_AlreadyLatest

internal/update/update_test.go:41–55  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

39}
40
41func 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
57func TestCheckForUpdate_DevVersion(t *testing.T) {
58 release := Release{TagName: "v1.0.0"}

Callers

nothing calls this directly

Calls 1

CheckForUpdateFunction · 0.85

Tested by

no test coverage detected