Skip to content

Commit 2898641

Browse files
authored
Fix deprecated cargo_bin usage in CLI tests (#272)
fix: replace deprecated cargo_bin with cargo_bin! macro in CLI tests
1 parent a2ea802 commit 2898641

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/cli.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use tempfile::tempdir;
1010
// Assert help text includes the --groups flag
1111
#[test]
1212
fn help_groups() -> Result<(), Box<dyn std::error::Error>> {
13-
let mut command = Command::cargo_bin("azure-init")?;
13+
let mut command = Command::new(assert_cmd::cargo::cargo_bin!("azure-init"));
1414
command.arg("--help");
1515
command
1616
.assert()
@@ -23,7 +23,7 @@ fn help_groups() -> Result<(), Box<dyn std::error::Error>> {
2323
// Ensure no password-related flags are exposed by the CLI
2424
#[test]
2525
fn help_has_no_password_flags() -> Result<(), Box<dyn std::error::Error>> {
26-
let mut command = Command::cargo_bin("azure-init")?;
26+
let mut command = Command::new(assert_cmd::cargo::cargo_bin!("azure-init"));
2727
command.arg("--help");
2828
command
2929
.assert()
@@ -36,7 +36,7 @@ fn help_has_no_password_flags() -> Result<(), Box<dyn std::error::Error>> {
3636
// Assert that the --version flag works and outputs the version
3737
#[test]
3838
fn version_flag() -> Result<(), Box<dyn std::error::Error>> {
39-
let mut command = Command::cargo_bin("azure-init")?;
39+
let mut command = Command::new(assert_cmd::cargo::cargo_bin!("azure-init"));
4040
command.arg("--version");
4141
command
4242
.assert()
@@ -49,7 +49,7 @@ fn version_flag() -> Result<(), Box<dyn std::error::Error>> {
4949
// Assert that the -V flag works and outputs the version
5050
#[test]
5151
fn version_flag_short() -> Result<(), Box<dyn std::error::Error>> {
52-
let mut command = Command::cargo_bin("azure-init")?;
52+
let mut command = Command::new(assert_cmd::cargo::cargo_bin!("azure-init"));
5353
command.arg("-V");
5454
command
5555
.assert()
@@ -110,7 +110,7 @@ fn clean_removes_only_provision_files_without_log_arg(
110110
);
111111
assert!(log_file.exists(), "log file should exist before cleaning");
112112

113-
let mut cmd = Command::cargo_bin("azure-init")?;
113+
let mut cmd = Command::new(assert_cmd::cargo::cargo_bin!("azure-init"));
114114
cmd.args(["--config", config_path.to_str().unwrap(), "clean"]);
115115

116116
cmd.assert().success();
@@ -138,7 +138,7 @@ fn clean_removes_provision_and_log_files_with_log_arg(
138138
);
139139
assert!(log_file.exists(), "log file should exist before cleaning");
140140

141-
let mut cmd = Command::cargo_bin("azure-init")?;
141+
let mut cmd = Command::new(assert_cmd::cargo::cargo_bin!("azure-init"));
142142
cmd.args(["--config", config_path.to_str().unwrap(), "clean", "--logs"]);
143143

144144
cmd.assert().success();

0 commit comments

Comments
 (0)