use predicates::prelude::*; use super::*; #[test] fn aliases() { for subcmd in ["u", "update"] { for opt in ["-h", "--help"] { cmd("bite bugzilla attachment") .arg(subcmd) .arg(opt) .assert() .stdout(predicate::str::is_empty().not()) .stderr("") .success(); } } } #[test] fn required_args() { // missing IDs cmd("bite bugzilla attachment update") .assert() .stdout("") .stderr(predicate::str::contains( "required arguments were not provided", )) .failure() .code(2); } #[tokio::test] async fn auth_required() { let _server = start_server().await; cmd("bite bugzilla attachment update 1 -p") .assert() .stdout("") .stderr(predicate::str::diff("Error: authentication required").trim()) .failure(); }