mirror of
https://github.com/casey/just.git
synced 2024-11-27 09:15:08 +03:00
dcc98abdf8
Currently, the `--completions` subcommand will fail if there is no justfile present. A justfile isn't needed to print completions, so fix this.
23 lines
444 B
Rust
23 lines
444 B
Rust
use std::process::Command;
|
|
|
|
use executable_path::executable_path;
|
|
use tempfile::tempdir;
|
|
|
|
#[test]
|
|
fn output() {
|
|
let tempdir = tempdir().unwrap();
|
|
|
|
let output = Command::new(executable_path("just"))
|
|
.arg("--completions")
|
|
.arg("bash")
|
|
.current_dir(tempdir.path())
|
|
.output()
|
|
.unwrap();
|
|
|
|
assert!(output.status.success());
|
|
|
|
let text = String::from_utf8_lossy(&output.stdout);
|
|
|
|
assert!(text.starts_with("_just() {"));
|
|
}
|