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

Function TestCmdInitSkipsSkillIfAlreadyPresent

internal/app/init_test.go:100–120  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

98}
99
100func TestCmdInitSkipsSkillIfAlreadyPresent(t *testing.T) {
101 initTempFlowRoot(t)
102 home := os.Getenv("HOME")
103 skillPath := filepath.Join(home, ".claude", "skills", "flow", "SKILL.md")
104 if err := os.MkdirAll(filepath.Dir(skillPath), 0o755); err != nil {
105 t.Fatal(err)
106 }
107 if err := os.WriteFile(skillPath, []byte("existing content"), 0o644); err != nil {
108 t.Fatal(err)
109 }
110 if rc := cmdInit(nil); rc != 0 {
111 t.Fatalf("cmdInit rc=%d", rc)
112 }
113 data, err := os.ReadFile(skillPath)
114 if err != nil {
115 t.Fatal(err)
116 }
117 if string(data) != "existing content" {
118 t.Errorf("init overwrote existing skill: %q", string(data))
119 }
120}
121
122func TestCmdInitRejectsExtraArgs(t *testing.T) {
123 initTempFlowRoot(t)

Callers

nothing calls this directly

Calls 2

initTempFlowRootFunction · 0.85
cmdInitFunction · 0.85

Tested by

no test coverage detected