Skip to content

Commit 521c3af

Browse files
committed
tests: use temp_dir for cli integration tmp_dir
1 parent 28ce21f commit 521c3af

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

cli/tests/cli_integration.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,13 @@ fn ontoenv_bin() -> PathBuf {
2828
}
2929

3030
fn tmp_dir(name: &str) -> PathBuf {
31-
let mut d = std::env::current_dir().unwrap();
32-
d.push(format!(
33-
"target/cli_integration_{}_{}",
34-
name,
35-
std::process::id()
36-
));
37-
if d.exists() {
38-
let _ = fs::remove_dir_all(&d);
31+
let mut base = std::env::temp_dir();
32+
base.push(format!("ontoenv-cli-{}-{}", name, std::process::id()));
33+
if base.exists() {
34+
let _ = fs::remove_dir_all(&base);
3935
}
40-
fs::create_dir_all(&d).unwrap();
41-
d
36+
fs::create_dir_all(&base).unwrap();
37+
base
4238
}
4339

4440
fn write_ttl(path: &PathBuf, ontology_uri: &str, extra: &str) {

0 commit comments

Comments
 (0)