{"modulePath":"github.com/puma/puma-dev","version":"v0.18.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package devtest\n\n## Variables\n\n```go\nvar (\n\tDebugLoggingEnabled = os.Getenv(\"DEBUG_LOG\") == \"1\"\n\tStubbedArgs         = make(map[string]int)\n\n\tProjectRoot = filepath.Join(filepath.Dir(b), \"..\", \"..\")\n)\n```\n\n## Functions\n\n```go\nfunc DirExists(dirname string) bool\n```\nDirExists returns true if a directory exists at the given path.\n\n```go\nfunc EnsurePumaDevDirectory()\n```\nEnsurePumaDevDirectory creates ~/.puma-dev if it does not already exist.\n\n```go\nfunc FileExists(filename string) bool\n```\nFileExists returns true if a regular file exists at the given path.\n\n```go\nfunc LinkAllTestApps(t *testing.T, workingDirPath string) func()\n```\n\n```go\nfunc LinkTestApps(t *testing.T, workingDirPath string, testAppsToLink map[string]string) func()\n```\n\n```go\nfunc LogDebugf(msg string, vars ...interface{})\n```\nLogDebugf prints a formatted log message if DEBUG\\_LOG=1\n\n```go\nfunc MakeDirectoryOrFail(t *testing.T, path string) func()\n```\nMakeDirectoryOrFail makes a directory or fails the test, returning the path of the directory that was created.\n\n```go\nfunc RemoveAppSymlinkOrFail(t *testing.T, name string)\n```\nRemoveAppSymlinkOrFail deletes a symlink at ~/.puma-dev/{name} or fails the test.\n\n```go\nfunc RemoveDirectoryOrFail(t *testing.T, path string)\n```\nRemoveDirectoryOrFail removes a directory (and its contents) or fails the test.\n\n```go\nfunc SetFlagOrFail(t *testing.T, flagName string, flagValue string)\n```\nSetFlagOrFail sets the value of a flag or fails the given testing.T\n\n```go\nfunc StubCommandLineArgs(args ...string)\n```\nStubCommandLineArgs 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.\n\n```go\nfunc WithStdoutCaptured(f func()) string\n```\nWithStdoutCaptured executes the passed function and returns a string containing the stdout of the executed function.\n\n```go\nfunc WithWorkingDirectory(path string, f func())\n```\nWithWorkingDirectory executes the passed function within the context of the passed working directory path. If the directory does not exist, panic.\n\n","path":"github.com/puma/puma-dev/dev/devtest","name":"devtest","synopsis":"","isRedistributable":true}
