Documentation ¶
Index ¶
- func ClearEnvs(t *testing.T)
- func Cwd() (cwd string)
- func FileExists(t *testing.T, filePath string) (bool, error)
- func Fromtemp(t *testing.T) func()
- func Mktemp(t *testing.T) (string, func())
- func RunGitServer(root string, t *testing.T) (url string)
- func ServeRepo(name string, t *testing.T) string
- func Using(t *testing.T, root string) func()
- func WithExecutable(t *testing.T, name, goSrc string)
- func Within(t *testing.T, root string) func()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearEnvs ¶
ClearEnvs sets all environment variables with the prefix of FUNC_ to empty (unsets) for the duration of the test t and is used when a test needs to completely clear dubbo-related envs prior to running.
func Cwd ¶
func Cwd() (cwd string)
Cwd returns the current working directory or panic if unable to determine.
func FileExists ¶
FileExists checks whether file on the specified path exists
func Mktemp ¶
Mktemp creates a temporary directory, CDs the current processes (test) to said directory, and returns the path to said directory. Usage:
path, rm := Mktemp(t) defer rm() CWD is now 'path'
errors encountererd fail the current test.
func RunGitServer ¶
RunGitServer starts serving git HTTP server and returns its address
func ServeRepo ¶
ServeRepo [name] from ./testdata/[name] returning URL at which the named repository is available. Must be called before any helpers which change test working directory such as fromTempDirectory(t)
func Using ¶
Using the given path, create it as a new directory and return a deferrable which will remove it. usage:
defer using(t, "testdata/example.com/someExampleTest")()
func WithExecutable ¶
WithExecutable creates an executable of the given name and source in a temp directory which is then added to PATH. Returned is a deferrable which will clean up both the script and PATH.
Types ¶
This section is empty.