insta-cmd icon indicating copy to clipboard operation
insta-cmd copied to clipboard

Snapshots via `cargo run`

Open cnpryer opened this issue 1 year ago • 1 comments

Is there a reason to target the binary directly and not sit on top of cargo run?

cnpryer avatar Jul 17 '23 02:07 cnpryer

You can even target the built test binary directly with Command::new(env!("CARGO_BIN_EXE_<name>")).args([]) where <name> is the [[bin]] name.

@mitsuhiko Probably worth to change here: https://docs.rs/insta-cmd/latest/insta_cmd/#testing-binaries

As explained here: https://github.com/iqlusioninc/abscissa/issues/845

And the reason not to use something cargo run based, is also explained there.

simonsan avatar Mar 01 '24 02:03 simonsan

I don't remember when this was added, or if I had just missed it, but get_cargo_bin works.

cnpryer avatar May 03 '24 23:05 cnpryer

I don't remember when this was added, or if I had just missed it, but get_cargo_bin works.

Ah, nice! :D

simonsan avatar May 04 '24 01:05 simonsan