use std::path::PathBuf;
use std::process::Command;
fn fixture(name: &str) -> PathBuf {
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("tests/fixtures/workflow")
.join(name)
}
fn workflow_exit(name: &str) -> i32 {
Command::new(env!("CARGO_BIN_EXE_testing-conventions"))
.arg("workflow")
.arg(fixture(name))
.status()
.expect("the built binary should run")
.code()
.expect("the process should exit with a code")
}
#[test]
fn red_workflow_exits_nonzero() {
assert_eq!(workflow_exit("red"), 1);
}
#[test]
fn clean_workflow_exits_zero() {
assert_eq!(workflow_exit("clean"), 0);
}