Help us shape the future of Go! Take the 2026 Go Developer Survey

test

package
v0.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertContents

func AssertContents(t *testing.T, fs afero.Fs, expectedPath, contentPath string)

AssertContents asserts the contents of a file.

func AssertDirectoriesMatch added in v0.12.0

func AssertDirectoriesMatch(t *testing.T, fs afero.Fs, rootA string, rootB string)

AssertDirectoriesMatch compares the contents of two directories (recursively) and asserts they are equivelent.

func AssertExists

func AssertExists(t *testing.T, fs afero.Fs, path string)

AssertExists asserts if a path exists.

func AssertExpectedPaths added in v0.13.0

func AssertExpectedPaths(t *testing.T, fs afero.Fs, root string, expected []string)

AssertExpectedPaths compares the contents of a path with a set of expected paths

func AssertNotExists

func AssertNotExists(t *testing.T, fs afero.Fs, path string)

AssertNotExists asserts a path does exist.

func AssertOutput

func AssertOutput(t *testing.T, filename, actual string)

AssertOutput asserts the output matches the actual contents

func DumpFs added in v0.12.0

func DumpFs(t *testing.T, fs afero.Fs)

dumpFs logs the contents of an afero.Fs virtual filesystem interface.

func FakeHTTPClient added in v0.13.0

func FakeHTTPClient(resp *http.Response, err error) *http.Client

FakeHTTPClient returns an http.Client that will respond with the predefined response and error.

func ReadTestData

func ReadTestData(t *testing.T, name string) string

ReadTestData reads a file from `testdata` and returns it as a string.

func StageDir

func StageDir(t *testing.T, fs afero.Fs, src, dest string)

StageDir stages a directory on the provided filesystem from testdata.

func StageFile

func StageFile(t *testing.T, fs afero.Fs, src, dest string)

StageFile stages a file on on the provided filesystem from testdata.

func WithApp

func WithApp(t *testing.T, root string, fn func(*mocks.App, afero.Fs))

WithApp runs an enclosure with a mocked app and fs.

func WithAppFs

func WithAppFs(t *testing.T, root string, fs afero.Fs, fn func(*mocks.App, afero.Fs))

WithAppFs runs an enclosure with a mocked app and fs. Allow supplying the fs.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL