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

Function TestSpecCommand_WritesToDirectory

apps/cli/internal/cli/spec_test.go:10–31  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestSpecCommand_WritesToDirectory(t *testing.T) {
11 tmpDir := t.TempDir()
12
13 specForce = false
14 specStdout = false
15 taskDir = tmpDir
16
17 err := runSpec(specCmd, []string{})
18 if err != nil {
19 t.Fatalf("unexpected error: %v", err)
20 }
21
22 outputPath := filepath.Join(tmpDir, specFilename)
23 content, err := os.ReadFile(outputPath)
24 if err != nil {
25 t.Fatalf("failed to read created file: %v", err)
26 }
27
28 if !bytes.Equal(content, specTemplate) {
29 t.Error("written content does not match embedded spec")
30 }
31}
32
33func TestSpecCommand_RefusesOverwriteWithoutForce(t *testing.T) {
34 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 2

runSpecFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected