Open
Description
Using crate atty
:
let stdout_is_a_tty: bool = atty::is(Stream::Stdout);
if stdout_is_a_tty { "<encode data into lossy UTF-8 to print into the terminal>" } else { "<binary output>" }
When I run tests, stdout_is_a_tty
is always false, hence I can't test the textual "to-terminal" output of my program, which I really need to test somehow. Ideally there should be some switch in assert_cmd... I really don't want to use env variables to force that behavior, it'd be very hacky.
Thank you for creating and maintaining this crate, really helps me test my software even the way it is right now!