| 38 | } |
| 39 | |
| 40 | func TestInstallDir(t *testing.T) { |
| 41 | t.Setenv(claudeConfigDirEnv, "") |
| 42 | |
| 43 | tests := []struct { |
| 44 | name string |
| 45 | setup func(*testing.T) |
| 46 | hostID string |
| 47 | scope Scope |
| 48 | gitRoot string |
| 49 | homeDir string |
| 50 | wantDir string |
| 51 | wantErr bool |
| 52 | }{ |
| 53 | { |
| 54 | name: "github copilot project scope", |
| 55 | hostID: "github-copilot", |
| 56 | scope: ScopeProject, |
| 57 | gitRoot: "/tmp/monalisa-repo", |
| 58 | homeDir: "/home/monalisa", |
| 59 | wantDir: filepath.Join("/tmp/monalisa-repo", ".agents", "skills"), |
| 60 | }, |
| 61 | { |
| 62 | name: "github copilot user scope", |
| 63 | hostID: "github-copilot", |
| 64 | scope: ScopeUser, |
| 65 | gitRoot: "/tmp/monalisa-repo", |
| 66 | homeDir: "/home/monalisa", |
| 67 | wantDir: filepath.Join("/home/monalisa", ".copilot", "skills"), |
| 68 | }, |
| 69 | { |
| 70 | name: "claude code project scope", |
| 71 | hostID: "claude-code", |
| 72 | scope: ScopeProject, |
| 73 | gitRoot: "/tmp/monalisa-repo", |
| 74 | homeDir: "/home/monalisa", |
| 75 | wantDir: filepath.Join("/tmp/monalisa-repo", ".claude", "skills"), |
| 76 | }, |
| 77 | { |
| 78 | name: "claude code user scope", |
| 79 | hostID: "claude-code", |
| 80 | scope: ScopeUser, |
| 81 | gitRoot: "/tmp/monalisa-repo", |
| 82 | homeDir: "/home/monalisa", |
| 83 | wantDir: filepath.Join("/home/monalisa", ".claude", "skills"), |
| 84 | }, |
| 85 | { |
| 86 | name: "claude code user scope, respect env var", |
| 87 | setup: func(t *testing.T) { |
| 88 | t.Setenv("CLAUDE_CONFIG_DIR", filepath.Join("/home", "monalisa", ".config", "claude")) |
| 89 | }, |
| 90 | hostID: "claude-code", |
| 91 | scope: ScopeUser, |
| 92 | gitRoot: "/tmp/monalisa-repo", |
| 93 | homeDir: "/home/monalisa", |
| 94 | wantDir: filepath.Join("/home", "monalisa", ".config", "claude", "skills"), |
| 95 | }, |
| 96 | { |
| 97 | name: "cursor project scope", |