Expand description

test_dir

TestDir is a temporary directory builder. The target is to define a file structure for test purpose. It is not recommended to use in non-test environment.

use std::path::PathBuf;
use test_dir::{TestDir,FileType,DirBuilder};

let temp = TestDir::temp()
    .create("test/dir", FileType::Dir)
    .create("test/file", FileType::EmptyFile)
    .create("test/random_file", FileType::RandomFile(100))
    .create("otherdir/zero_file", FileType::ZeroFile(100));

let path: PathBuf = temp.path("test/random_file");
assert!(path.exists());

Structs

Temporary directory

Test directory creator

Enums

Supported file types with TestDir

Traits

File structure builder trait