cli

package
v1.0.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureStdOut

func CaptureStdOut(t *testing.T) (*os.File, *os.File, *os.File)

CaptureStdOut creates a pipe to capture standard output and returns the original handle to stdout as well as a file handles for the created pipe.

func CreateExitHandlerFunc

func CreateExitHandlerFunc(t *testing.T, stdOutWriter *os.File, stdOutReader *os.File, expectedExitCode int, expectedErrorMessage string) func(int) int

func HideEnv

func HideEnv(t *testing.T) func(t *testing.T)

Temporarily unsets the env variables for the test cases returns a function to reset them to their initial values

func InitTestConfig

func InitTestConfig(config string) error

func RunCommand

func RunCommand(f func(*cobra.Command, []string))

func SetOptionValue

func SetOptionValue(t *testing.T, testOption TestOption)

func SetupTmpMinishiftHome

func SetupTmpMinishiftHome(t *testing.T) string

SetupTmpMinishiftHome creates a tmp directory and points MINISHIFT_HOME to it. It returns the path to this tmp directory

func TearDown

func TearDown(testDir string, origStdout *os.File)

func UnsetValues

func UnsetValues(testOption TestOption)

Types

type TestOption

type TestOption struct {
	Name          string
	EnvValue      string
	ConfigValue   string
	FlagValue     string
	ExpectedValue string
}

Jump to

Keyboard shortcuts

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