Add failure test
This commit is contained in:
parent
e845544035
commit
ee9270d771
@ -22,9 +22,17 @@ async fn main() {
|
|||||||
use assert_cmd::Command;
|
use assert_cmd::Command;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_example() {
|
fn test_example_success() {
|
||||||
let mut cmd = Command::cargo_bin("example-cli").unwrap();
|
let mut cmd = Command::cargo_bin("example-cli").unwrap();
|
||||||
let assert = cmd.arg("--run").arg("SuccessScore").assert();
|
let assert = cmd.args(&["--run", "--filter", "SuccessScore"]).assert();
|
||||||
|
|
||||||
assert.success();
|
assert.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_example_fail() {
|
||||||
|
let mut cmd_fail = Command::cargo_bin("example-cli").unwrap();
|
||||||
|
let assert_fail = cmd_fail.args(&["--run", "--filter", "ErrorScore"]).assert();
|
||||||
|
|
||||||
|
assert_fail.failure();
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user