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