use std::path::{Path, PathBuf};
use std::time::{SystemTime, UNIX_EPOCH};
pub(crate) struct TempProject {
pub(crate) fn new(label: &str) -> Self {
let nanos = SystemTime::now()
.duration_since(UNIX_EPOCH)
.expect("system time should be after epoch")
let path = env::temp_dir().join(format!(
"xtazy-dealer-test-{}-{label}-{nanos}",
fs::create_dir_all(&path).expect("temp project should be created");
pub(crate) fn path(&self) -> &Path {
impl Drop for TempProject {
let _ = fs::remove_dir_all(&self.path);