MCPcopy Index your code
hub / github.com/cli/cli / TestInstallDir

Function TestInstallDir

internal/skills/registry/registry_test.go:40–171  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

38}
39
40func 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",

Callers

nothing calls this directly

Calls 6

FindByIDFunction · 0.85
JoinMethod · 0.80
InstallDirMethod · 0.80
EqualMethod · 0.80
RunMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected