Start fish in an isolated env (#128)

This commit is contained in:
Ajeet D'Souza 2020-12-13 10:56:51 +05:30 committed by GitHub
parent 14b150c1f7
commit 418b82524b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,7 +144,12 @@ mod tests {
fn fish_fish_#i() {
let opts = dbg!(&opts()[i]);
let source = Fish(opts).render().unwrap();
let tempdir = tempfile::tempdir().unwrap();
let tempdir = tempdir.path().to_str().unwrap();
Command::new("fish")
.env("HOME", tempdir) // fish needs a writeable $HOME directory
.args(&["--command", &source, "--private"])
.assert()
.success()