(t *testing.T)
| 291 | } |
| 292 | |
| 293 | func TestRunPluginHooksPassesErrorMessage(t *testing.T) { |
| 294 | cfg := configfile.New("") |
| 295 | cfg.Plugins = map[string]map[string]string{ |
| 296 | "test-plugin": {"hooks": "build"}, |
| 297 | } |
| 298 | provider := &fakeConfigProvider{cfg: cfg} |
| 299 | root := &cobra.Command{Use: "docker"} |
| 300 | sub := &cobra.Command{Use: "build"} |
| 301 | root.AddCommand(sub) |
| 302 | |
| 303 | // Should not panic with empty error message (success case) |
| 304 | RunPluginHooks(context.Background(), provider, root, sub, []string{"build"}, "") |
| 305 | |
| 306 | // Should not panic with non-empty error message (failure case) |
| 307 | RunPluginHooks(context.Background(), provider, root, sub, []string{"build"}, "exit status 1") |
| 308 | } |
| 309 | |
| 310 | func TestRunPluginHooksErrorHooks(t *testing.T) { |
| 311 | cfg := configfile.New("") |
nothing calls this directly
no test coverage detected
searching dependent graphs…