MCPcopy Create free account
hub / github.com/Facets-cloud/flow / TestMaybeAutoUpgradeIdempotent

Function TestMaybeAutoUpgradeIdempotent

internal/app/version_test.go:74–93  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

72}
73
74func TestMaybeAutoUpgradeIdempotent(t *testing.T) {
75 home := withTempHome(t)
76 withVersion(t, "v1.0.0")
77 if rc := cmdSkill([]string{"install"}); rc != 0 {
78 t.Fatalf("install rc=%d", rc)
79 }
80 skillPath := filepath.Join(home, ".claude", "skills", "flow", "SKILL.md")
81 before, _ := os.Stat(skillPath)
82
83 // Same version → no rewrite.
84 maybeAutoUpgradeSkill()
85
86 after, err := os.Stat(skillPath)
87 if err != nil {
88 t.Fatal(err)
89 }
90 if !before.ModTime().Equal(after.ModTime()) {
91 t.Error("auto-upgrade rewrote SKILL.md when version was unchanged")
92 }
93}
94
95func TestMaybeAutoUpgradeSkipsForDev(t *testing.T) {
96 home := withTempHome(t)

Callers

nothing calls this directly

Calls 5

withTempHomeFunction · 0.85
withVersionFunction · 0.85
cmdSkillFunction · 0.85
maybeAutoUpgradeSkillFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected