assert_cmd icon indicating copy to clipboard operation
assert_cmd copied to clipboard

Assert#dump()

Open yegor256 opened this issue 3 years ago • 2 comments

Would be nice to have a new method dump():

assert_cmd::Command::cargo_bin("foo")
  .unwrap()
  .current_dir(tmp.path())
  .arg("--verbose")
  .arg("bar")
  .assert()
  .dump() // here!
  .success();

It should print the entire stdout and stderr to console. This would be very convenient for debugging purposes.

yegor256 avatar Sep 25 '22 12:09 yegor256

I'm ok with someone implementing that. We would need to decide on the name first.

Might seem odd but I'd like a name that also works for snapbox so I can carry this change forward to that crate as well. I worry dump might be taken to mean "dump to disk" (like SNAPSHOTS=dump.

Some name ideas

  • dbg
  • print
  • log

epage avatar Sep 26 '22 15:09 epage

@yegor256 I like print, since it's the closest to println! we usually use to print something temporary to console

yegor256 avatar Sep 26 '22 16:09 yegor256