Skip to content

Commit 58bede8

Browse files
committed
fix(q_cli): Replace deprecated cargo_bin with cargo_bin! macro
Replace deprecated assert_cmd::cargo::CommandCargoExt::cargo_bin method with the recommended cargo_bin! macro in test files to fix compilation warnings and ensure compatibility with custom cargo build directories. 🤖 Assisted by Amazon Q Developer
1 parent 1fb6322 commit 58bede8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

crates/q_cli/tests/common/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub use predicates::prelude::*;
1010
pub type Result<T, E = Box<dyn std::error::Error>> = std::result::Result<T, E>;
1111

1212
pub fn cli() -> Command {
13-
Command::cargo_bin(CLI_CRATE_NAME).unwrap()
13+
Command::new(assert_cmd::cargo::cargo_bin!("q_cli"))
1414
}
1515

1616
pub fn is_json() -> FnPredicate<impl Fn(&str) -> bool, str> {

crates/q_cli/tests/init.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ macro_rules! init_test {
2222
paste! {
2323
#[cfg(not(windows))]
2424
fn [<init_output_ $shell _ $stage _ $file>]() -> Result<String, Box<dyn std::error::Error>> {
25-
let mut cmd = Command::cargo_bin(CLI_CRATE_NAME)?;
25+
let mut cmd = Command::new(assert_cmd::cargo::cargo_bin!("q_cli"));
2626
cmd.arg("init").arg($shell).arg($stage).arg("--rcfile").arg($file);
2727
cmd.env("Q_INIT_SNAPSHOT_TEST", "1");
2828
let out = cmd.assert().success().get_output().stdout.clone();

0 commit comments

Comments
 (0)