use std::path::PathBuf;
use std::process::Command;
fn fixtures() -> PathBuf {
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/colocated_test")
}
fn unit_colocated_test_exit(fixture: &str, language: &str) -> i32 {
let dir = fixtures().join(fixture);
Command::new(env!("CARGO_BIN_EXE_testing-conventions"))
.args(["unit", "colocated-test", "--language", language, "--config"])
.arg(dir.join("testing-conventions.toml"))
.arg(&dir)
.status()
.expect("the built binary should run")
.code()
.expect("the process should exit with a code")
}
#[test]
fn config_exemptions_clear_the_tree() {
assert_eq!(unit_colocated_test_exit("python_exempt", "python"), 0);
}
#[test]
fn a_blank_reason_exemption_makes_the_binary_error() {
assert_eq!(unit_colocated_test_exit("bad_exempt", "python"), 1);
}