(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestRunPluginInstall(t *testing.T) { |
| 11 | home := t.TempDir() |
| 12 | |
| 13 | out := captureOutput(func() { |
| 14 | RunPlugin([]string{"install", "--home", home}) |
| 15 | }) |
| 16 | |
| 17 | checks := []string{ |
| 18 | "codemap plugin install", |
| 19 | "Plugin:", |
| 20 | "Marketplace:", |
| 21 | "Marketplace entry: created", |
| 22 | } |
| 23 | for _, check := range checks { |
| 24 | if !strings.Contains(out, check) { |
| 25 | t.Fatalf("expected output to contain %q, got:\n%s", check, out) |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | pluginJSON := filepath.Join(home, "plugins", "codemap", ".codex-plugin", "plugin.json") |
| 30 | if _, err := os.Stat(pluginJSON); err != nil { |
| 31 | t.Fatalf("expected installed plugin manifest to exist: %v", err) |
| 32 | } |
| 33 | } |
nothing calls this directly
no test coverage detected