fn test_create_all_and_write()

in gazebo/src/file.rs [55:71]


    fn test_create_all_and_write() -> io::Result<()> {
        // Make sure we create the directory with unique entropy in it (so no clashes)
        // and clean up after ourselves (so we don't leak files)
        let temp = std::env::temp_dir();
        let temp = temp.join("gazebo");
        let temp = temp.join(random_part());
        // We don't delete $TMP/gazebo because someone else might be using that
        let remove_dir = RemoveDir(temp.clone());

        let temp = temp.join("foo/bar");
        create_dirs_and_write(&temp, "contents")?;
        let contents = fs::read_to_string(temp)?;
        assert_eq!(contents, "contents");

        drop(remove_dir);
        Ok(())
    }