executeCmd runs a command through the root cobra command and captures stdout.
(args ...string)
| 34 | |
| 35 | // executeCmd runs a command through the root cobra command and captures stdout. |
| 36 | func executeCmd(args ...string) (string, error) { |
| 37 | RootCmd.SetArgs(args) |
| 38 | var execErr error |
| 39 | output := testutil.CaptureStdout(func() { |
| 40 | execErr = RootCmd.Execute() |
| 41 | }) |
| 42 | return output, execErr |
| 43 | } |
| 44 | |
| 45 | // --- Step 7: Table Output Tests --- |
| 46 |
no test coverage detected