fixtures

package
v0.17.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileFixtures

type FileFixtures struct {

	// If an error has occurred setting up fixtures
	Error error
	// contains filtered or unexported fields
}

FileFixtures writes files to a temporary location for use in testing.

func NewFileFixtures

func NewFileFixtures(identifyingPrefix string) *FileFixtures

Set up a new FileFixtures object by passing an interlaced list of file names and file contents. The file names will be interpreted as relative to some temporary root directory that is fixed when allocate() is called on the FileFixtures struct.

func (*FileFixtures) AddDir

func (ffs *FileFixtures) AddDir(name string) string

Ensure that the directory relative to the FileFixtures tempDir exists using name for the relative part of the path.

func (*FileFixtures) AddFile

func (ffs *FileFixtures) AddFile(name, content string) string

Add a file relative to the FileFixtures tempDir using name for the relative part of the path.

func (*FileFixtures) RemoveAll

func (ffs *FileFixtures) RemoveAll()

Cleans up the the temporary files (with fire)

func (*FileFixtures) TempDir

func (ffs *FileFixtures) TempDir() string

Returns the root temporary directory that this FileFixtures will populate and clear on RemoveAll()

Jump to

Keyboard shortcuts

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