temp-dir-builder 
Oftentimes, testing scenarios involve interactions with the file system. temp-dir-builder provides a convenient solution for creating file system trees tailored to the needs of your tests. This library offers:
- An easy way to generate a tree with recursive paths.
- Tree creation within a temporary folder.
- The ability to create a tree using a builder.
Usage
With the builder API, you can define file paths and contents in a structured way. Here’s how to create a tree with the builder:
When the temp_dir instance is dropped, the temporary folder and its contents are automatically deleted, which is particularly useful for tests that require a clean state.
use TempDirectoryBuilder;
let temp_dir = default
.add_text_file
.add_binary_file
.add_empty_file
.add_file
.add_directory
.build
.expect;
println!;
Credits
This is a fork of tree-fs I heavily rewritten, original idea by Elad Kaplan.