Documentation ¶
Index ¶
- Variables
- func CleanUp(t TestReporter)
- func DirContains(t TestReporter, dir string, path string) bool
- func Exists(t TestReporter, path string) bool
- func File(t TestReporter, path string, content string) afero.File
- func FileSays(t TestReporter, path string, expected []byte) bool
- func TmpDir(t TestReporter, dir string) string
- func TmpFile(t TestReporter, dir string, content string) afero.File
- type TestReporter
Constants ¶
This section is empty.
Variables ¶
View Source
var Files []string
Files keeps track of files that we've used so we can clean up.
Functions ¶
func CleanUp ¶
func CleanUp(t TestReporter)
CleanUp removes all files in our test registry and calls `t.Error` if something goes wrong.
func DirContains ¶
func DirContains(t TestReporter, dir string, path string) bool
DirContains returns true if the dir contains the path. Calls t.Error if something goes wrong while checking.
func Exists ¶
func Exists(t TestReporter, path string) bool
Exists returns true if the file exists. Calls t.Error if something goes wrong while checking.
func File ¶
func File(t TestReporter, path string, content string) afero.File
File Creates a specified file for us to use when testing
func FileSays ¶
func FileSays(t TestReporter, path string, expected []byte) bool
FileSays returns true if the file at the path contains the expected byte array content.
func TmpDir ¶
func TmpDir(t TestReporter, dir string) string
TmpDir Creates a tmp directory for us to use.
Types ¶
type TestReporter ¶
type TestReporter interface {
Error(args ...interface{})
}
TestReporter can be used to report test failures. It is satisfied by the standard library's *testing.T.
Click to show internal directories.
Click to hide internal directories.