[−][src]Crate test_dir
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
TempDir | Temporary directory |
TestDir | Test directory creator |
Enums
FileType | Supported file types with TestDir |
Traits
DirBuilder | File structure builder trait |