filet: github.com/Flaque/filet Index | Files

package filet

import "github.com/Flaque/filet"

Index

Package Files

filet.go

Variables

var Files []string

Files keeps track of files that we've used so we can clean up.

func CleanUp Uses

func CleanUp(t TestReporter)

CleanUp removes all files in our test registry and calls `t.Error` if something goes wrong.

func DirContains Uses

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 Uses

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 Uses

func File(t TestReporter, path string, content string) afero.File

File Creates a specified file for us to use when testing

func FileSays Uses

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 Uses

func TmpDir(t TestReporter, dir string) string

TmpDir Creates a tmp directory for us to use.

func TmpFile Uses

func TmpFile(t TestReporter, dir string, content string) afero.File

TmpFile Creates a tmp file for us to use when testing

type TestReporter Uses

type TestReporter interface {
    Error(args ...interface{})
}

TestReporter can be used to report test failures. It is satisfied by the standard library's *testing.T.

Package filet imports 4 packages (graph) and is imported by 2 packages. Updated 2019-02-25. Refresh now. Tools for package owners.