Skip to content

Dealing with old executables that are left over after a rename #247

@grothesque

Description

@grothesque

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions