newInfoFixture builds a SkillHandler whose registry install dir is a temp directory we control. Returns (handler, installDir). Tests can pre-populate installDir with skill packages and then call sh.Info.
(t *testing.T)
| 27 | // temp directory we control. Returns (handler, installDir). Tests can |
| 28 | // pre-populate installDir with skill packages and then call sh.Info. |
| 29 | func newInfoFixture(t *testing.T) (*SkillHandler, string) { |
| 30 | t.Helper() |
| 31 | tmp := t.TempDir() |
| 32 | t.Setenv("CHATCLI_SKILL_INSTALL_DIR", tmp) |
| 33 | mgr := persona.NewManager(zap.NewNop()) |
| 34 | sh := NewSkillHandler(zap.NewNop(), mgr) |
| 35 | if sh.registryMgr == nil { |
| 36 | t.Fatal("registryMgr unexpectedly nil after NewSkillHandler") |
| 37 | } |
| 38 | if got := sh.registryMgr.GetInstallDir(); got != tmp { |
| 39 | t.Fatalf("registry install dir = %q, want %q (env override not honored)", got, tmp) |
| 40 | } |
| 41 | return sh, tmp |
| 42 | } |
| 43 | |
| 44 | func writeInstalledSkill(t *testing.T, installDir, qualifiedName, body string) { |
| 45 | t.Helper() |
no test coverage detected