create_dir_all

Function create_dir_all 

Source
pub fn create_dir_all(path_dir: &str) -> Result<()>
Expand description

Create a directory path if it does not exist. Will not throw an error if the directory already exists. Use to guarantee the filesystem state before a test runs.

ยงExample

use common_testing::setup;

#[test]
fn test_1() {
  setup::create_dir_all("./.tmp/tests/test_1").unwrap();
  setup::write_file_contents("./.tmp/tests/test_1/test.txt", &[1, 2, 3]).unwrap();
  // some test code
}