1
1
mirror of https://github.com/casey/just.git synced 2024-11-26 23:27:26 +03:00
just/tests/tempdir.rs

37 lines
555 B
Rust
Raw Normal View History

2022-10-26 02:57:20 +03:00
use super::*;
2021-07-04 00:26:59 +03:00
pub(crate) fn tempdir() -> tempfile::TempDir {
tempfile::Builder::new()
.prefix("just-test-tempdir")
.tempdir()
.expect("failed to create temporary directory")
}
2022-10-26 02:57:20 +03:00
#[test]
fn test_tempdir_is_set() {
Test::new()
.justfile(
"
set tempdir := '.'
foo:
#!/usr/bin/env bash
cat just*/foo
",
)
.shell(false)
.tree(tree! {
foo: {
}
})
.current_dir("foo")
.stdout(
"
#!/usr/bin/env bash
cat just*/foo
",
)
.run();
}