MCPcopy Create free account
hub / github.com/driangle/taskmd / TestProjectInit_DirFlag

Function TestProjectInit_DirFlag

apps/cli/internal/cli/project_init_test.go:253–276  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

251}
252
253func TestProjectInit_DirFlag(t *testing.T) {
254 tmpDir := t.TempDir()
255 subDir := filepath.Join(tmpDir, "my-project")
256 if err := os.Mkdir(subDir, 0755); err != nil {
257 t.Fatalf("failed to create subdirectory: %v", err)
258 }
259
260 resetProjectInitFlags(subDir)
261
262 err := runProjectInit(projectInitCmd, []string{})
263 if err != nil {
264 t.Fatalf("unexpected error: %v", err)
265 }
266
267 claudePath := filepath.Join(subDir, "CLAUDE.md")
268 if _, err := os.Stat(claudePath); os.IsNotExist(err) {
269 t.Error("CLAUDE.md should have been created in subdirectory")
270 }
271
272 specPath := filepath.Join(subDir, specFilename)
273 if _, err := os.Stat(specPath); os.IsNotExist(err) {
274 t.Error("TASKMD_SPEC.md should have been created in subdirectory")
275 }
276}
277
278func TestProjectInit_StdoutPrintsWithoutCreatingFiles(t *testing.T) {
279 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 3

resetProjectInitFlagsFunction · 0.85
runProjectInitFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected