test

package
v0.15.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteCommand

func ExecuteCommand(root *cobra.Command, args ...string) (stdout string, stderr string, err error)

ExecuteCommand is a test utility function to execute the command with given args and returns the produced output and error as strings.

func ExecuteCommandC

func ExecuteCommandC(root *cobra.Command, args ...string) (c *cobra.Command, stdout string, stderr string, err error)

ExecuteCommandC is a test utility function to execute the command with given args and returns the result command and the produced output and error as strings.

func HasSubcommand

func HasSubcommand(t *testing.T, cmd *cobra.Command, name string, msgAndArgs ...interface{}) bool

HasSubcommand is an assertion helper that verifies if cobra.Command cmd has a specific child command

func ParsesBoolFlag

func ParsesBoolFlag(t *testing.T, cmd *cobra.Command, flag string, wantValue bool, args []string, msgAndArgs ...interface{}) bool

ParsesBoolFlag is an assertion helper that verifies that the given cobra.Command cmd parses a given bool flag

func ParsesStringFlag

func ParsesStringFlag(t *testing.T, cmd *cobra.Command, flag string, wantValue string, args []string, msgAndArgs ...interface{}) bool

ParsesStringFlag is an assertion helper that verifies that the given cobra.Command cmd parses a given string flag

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL