Skip to content

Commit b498222

Browse files
committed
Use modern functions
1 parent 263f139 commit b498222

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

clients/cli/tests/config.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
use assert_cmd::cmd::Command;
1+
use assert_cmd::cargo::cargo_bin_cmd;
22

33
#[test]
44
fn invalid_config_will_cause_commands_to_fail() {
5-
let mut cmd = Command::cargo_bin("spl-token").unwrap();
6-
cmd.args(["address", "--config", "~/nonexistent/config.yml"]);
7-
cmd.assert()
8-
.stderr("error: Could not find config file `~/nonexistent/config.yml`\n");
9-
cmd.assert().code(1).failure();
5+
let output = cargo_bin_cmd!("spl-token")
6+
.args(["address", "--config", "~/nonexistent/config.yml"])
7+
.output()
8+
.unwrap();
9+
assert_eq!(
10+
std::str::from_utf8(&output.stderr).unwrap(),
11+
"error: Could not find config file `~/nonexistent/config.yml`\n"
12+
);
13+
assert_eq!(output.status.code().unwrap(), 1);
14+
assert!(!output.status.success());
1015
}

0 commit comments

Comments
 (0)