Crate testfile[][src]

Create and manage temporary file used for unit tests. File is deleted on Drop

Structs

TestFile

TestFile structure. Holds opened File and PathBuf. Files are created in temporary directory with unique names. Deleted on Drop. This structure can be dereferenced to &File and implements AsRef for Path, PathBuf and File.

Functions

create

Create test file with content supplied by initializer closure

empty

Create an empty test file

from

Create a TestFile from string

from_file

Turns file into TestFile

generate_name

Generate unique tmp file name