INNER CODE UNIT · Go
setupTestCmd
helm-unittest/helm-unittest · cmd/helm-unittest/helm_unittest_test.go:15
func setupTestCmd() *cobra.Command {
buf := new(bytes.Buffer)
testCmd := &cobra.Command{
Use: "unittest",
Run: RunPlugin,
SilenceUsage: true,
SilenceErrors: true,
}
// silence tests
// redirect output to buffer
testCmd.SetIn(buf)
testCmd.SetOut(buf)
testCmd.SetErr(buf)
_, w, _ := os.Pipe()
os.Stdout = w
InitPluginFlags(testCmd)