diff options
Diffstat (limited to 'internal/api/elaborate_test.go')
| -rw-r--r-- | internal/api/elaborate_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/api/elaborate_test.go b/internal/api/elaborate_test.go index ff158a8..52f7fdf 100644 --- a/internal/api/elaborate_test.go +++ b/internal/api/elaborate_test.go @@ -8,6 +8,7 @@ import ( "net/http/httptest" "os" "path/filepath" + "strings" "testing" ) @@ -28,6 +29,23 @@ func createFakeClaude(t *testing.T, output string, exitCode int) string { return script } +func TestElaboratePrompt_ContainsWorkDir(t *testing.T) { + prompt := buildElaboratePrompt("/some/custom/path") + if !strings.Contains(prompt, "/some/custom/path") { + t.Error("prompt should contain the provided workDir") + } + if strings.Contains(prompt, "/root/workspace/claudomator") { + t.Error("prompt should not hardcode /root/workspace/claudomator") + } +} + +func TestElaboratePrompt_EmptyWorkDir(t *testing.T) { + prompt := buildElaboratePrompt("") + if strings.Contains(prompt, "/root") { + t.Error("prompt should not reference /root when workDir is empty") + } +} + func TestElaborateTask_Success(t *testing.T) { srv, _ := testServer(t) |
