In my test, I have
use assert_cmd::cargo::CommandCargoExt as _;
use std::process::Command;
and then later
let mut cmd = Command::cargo_bin("old_name")?
.args(args)
.stdout(Stdio::piped())
.spawn()?;
The tests are passing. The only problem is, that “old_name” no longer corresponds to the name of the executable that is being built! I had changed that name in “Cargo.toml”, but forgot to update the test. assert_cmd is not complaining, it happily runs the old file left over from old builds.
Is there something that I missed that would have helped to avoid this pitfall? If not, perhaps some way can be found to detect this?