testfs

package
v0.0.0-...-678bb0e Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(base string, layout map[string]string) error

Build constructs a filesystem hierarchy given a layout.

The layouts keys should be ToSlash-style file paths. Its values should be the content that is written at those paths. Intermediate directories will be automatically created.

To create a directory, end its path with a "/". In this case, the content will be ignored.

func MustWithTempDir

func MustWithTempDir(t *testing.T, prefix string, fn func(string)) func()

MustWithTempDir calls WithTempDir and panics if any failures occur.

func WithTempDir

func WithTempDir(t *testing.T, prefix string, fn func(string) error) error

WithTempDir creates a temporary directory and passes it to fn. After fn exits, the directory is cleaned up.

Types

This section is empty.

Jump to

Keyboard shortcuts

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