Documentation ¶
Overview ¶
Package exec provides an os/exec wrapper that can be overridden for testing purposes
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddTestProgram ¶
func AddTestProgram(path string)
AddTestProgram takes the full path to a program and allows that program to be be found via LookPath().
func AddTestResult ¶
AddTestResult tells exec to expect a call to Exec() with the given command line, and to return the given output or error in response. You must call AddTestResult() once for every time that Exec() will be called, in order.
func Exec ¶
Exec executes a command with the given arguments and returns either the combined stdout+stdin, or an error.
func SetTestMode ¶
func SetTestMode()
SetTestMode turns on "test mode". In test mode, the output of LookPath() and Exec() is determined by prior calls to AddTestProgram() and AddTestResult().
Types ¶
type TestResult ¶
type TestResult struct {
// contains filtered or unexported fields
}