Documentation ¶
Index ¶
- Variables
- func DirExists(dirname string) bool
- func EnsurePumaDevDirectory()
- func FileExists(filename string) bool
- func LogDebugf(msg string, vars ...interface{})
- func MakeDirectoryOrFail(t *testing.T, path string) func()
- func RemoveAppSymlinkOrFail(t *testing.T, name string)
- func RemoveDirectoryOrFail(t *testing.T, path string)
- func SetFlagOrFail(t *testing.T, flagName string, flagValue string)
- func StubCommandLineArgs(args ...string)
- func WithStdoutCaptured(f func()) string
- func WithWorkingDirectory(path string, f func())
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func EnsurePumaDevDirectory ¶
func EnsurePumaDevDirectory()
EnsurePumaDevDirectory creates ~/.puma-dev if it does not already exist.
func FileExists ¶
FileExists returns true if a regular file exists at the given path.
func LogDebugf ¶
func LogDebugf(msg string, vars ...interface{})
LogDebugf prints a formatted log message if DEBUG_LOG=1
func MakeDirectoryOrFail ¶
MakeDirectoryOrFail makes a directory or fails the test, returning the path of the directory that was created.
func RemoveAppSymlinkOrFail ¶
RemoveAppSymlinkOrFail deletes a symlink at ~/.puma-dev/{name} or fails the test.
func RemoveDirectoryOrFail ¶
RemoveDirectoryOrFail removes a directory (and its contents) or fails the test.
func SetFlagOrFail ¶
SetFlagOrFail sets the value of a flag or fails the given testing.T
func StubCommandLineArgs ¶
func StubCommandLineArgs(args ...string)
StubCommandLineArgs overrides command arguments to allow flag-based branches to execute. It does not modify os.Args[0] so it can be used for subprocess tests. It also resets all defined flags to their default values, as `flag.Parse()` will not reset non-existent boolean flags if they have been stubbed in other tests.
func WithStdoutCaptured ¶
func WithStdoutCaptured(f func()) string
WithStdoutCaptured executes the passed function and returns a string containing the stdout of the executed function.
func WithWorkingDirectory ¶
func WithWorkingDirectory(path string, f func())
WithWorkingDirectory executes the passed function within the context of the passed working directory path. If the directory does not exist, panic.
Types ¶
This section is empty.