Skip to content

Commit

Permalink
test: use tempdir instead of /tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunps committed Nov 27, 2023
1 parent bb078d7 commit 15ae106
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/project/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,7 @@ mod tests {
use rattler_conda_types::ChannelConfig;
use rattler_virtual_packages::{Archspec, Cuda, LibC, Linux, Osx, VirtualPackage};
use std::str::FromStr;
use tempfile::tempdir;

const PROJECT_BOILERPLATE: &str = r#"
[project]
Expand Down Expand Up @@ -1167,8 +1168,9 @@ mod tests {
baz = "*"
"#;

let mut project =
Project::from_manifest_str(&PathBuf::from("/tmp/"), file_contents).unwrap();
let tmpdir = tempdir().unwrap();

let mut project = Project::from_manifest_str(tmpdir.path(), file_contents).unwrap();

project
.remove_target_dependency(
Expand Down Expand Up @@ -1200,8 +1202,9 @@ mod tests {
baz = "*"
"#;

let mut project =
Project::from_manifest_str(&PathBuf::from("/tmp/"), file_contents).unwrap();
let tmpdir = tempdir().unwrap();

let mut project = Project::from_manifest_str(tmpdir.path(), file_contents).unwrap();

project
.remove_dependency(&PackageName::try_from("fooz").unwrap(), &SpecType::Run)
Expand Down

0 comments on commit 15ae106

Please sign in to comment.