mirror of
https://github.com/containers/youki
synced 2024-05-10 01:26:14 +02:00
use tempfile for testcase
This commit is contained in:
parent
2d0c6b0202
commit
26e345d190
|
@ -1546,4 +1546,5 @@ dependencies = [
|
|||
"serial_test",
|
||||
"systemd",
|
||||
"tabwriter",
|
||||
"tempfile",
|
||||
]
|
||||
|
|
|
@ -61,6 +61,7 @@ oci-spec = { git = "https://github.com/containers/oci-spec-rs", rev = "5018f8e5
|
|||
quickcheck = "1"
|
||||
serial_test = "0.5.1"
|
||||
ipc-channel = "0.15.0"
|
||||
tempfile = "3"
|
||||
|
||||
[profile.release]
|
||||
lto = true
|
||||
|
|
|
@ -117,7 +117,9 @@ mod tests {
|
|||
fn test_spec_json() -> Result<()> {
|
||||
let mut spec = Default::default();
|
||||
spec = set_for_rootless(&spec)?;
|
||||
to_writer_pretty(&File::create("config.json")?, &spec)?;
|
||||
let tmpdir = tempfile::tempdir().unwrap();
|
||||
let path = tmpdir.path().join("config.json");
|
||||
to_writer_pretty(&File::create(path)?, &spec)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue