Skip to content

Commit

Permalink
Assert that each temporary directory has a unique path
Browse files Browse the repository at this point in the history
  • Loading branch information
LibertyNJ committed Mar 10, 2024
1 parent 62ad2b0 commit 72ea131
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/temporary_directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,11 @@ mod tests {

assert!(path.try_exists().is_ok_and(|exists| !exists));
}

#[test]
fn it_should_return_a_unique_path_for_each_instance() {
let temp_dir_a = TemporaryDirectory::new().unwrap();
let temp_dir_b = TemporaryDirectory::new().unwrap();
assert_ne!(temp_dir_a.get_path(), temp_dir_b.get_path());
}
}

0 comments on commit 72ea131

Please sign in to comment.