Crate testfile

Source
Expand description

Temporary file management for unit tests.

Create and manage temporary files used for unit tests. Managed temporary files are created in system temporary directory with unique file names. They can be dereferenced as ordinary File and are automatically deleted during Drop.

Functions do not return Result <T,E> but panic! allowing you to focus on your tests and not on error handling.

Structs§

TestFile
Main TestFile structure.

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 an existing file into TestFile.
generate_name
Generate random unique tmp file name.