You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 29, 2021. It is now read-only.
This would be a big help to me. Another thing could be setting environment variables. Like many people I have my own hacky wrapper around std::process and I rely on stdin and environment variables to test my binary properly:
Would you be willing to get your with_stdin into a PR against assert_cli? I personally do not (yet) have opinions on the name (with_stdin, stdin, given_input).
I rely on stdin and environment variables to test my binary properly:
Freyskeyd is looking at handling environment variables in #27. Feel free to jump on over there to see how well our current plan will handle your needs and provide feedback.
I'm running into some difficulty. It's as if cwd changed due to my changes:
output=``````', src/assert.rs:316
note: Run with `RUST_BACKTRACE=1` for a backtrace.
test readme_sect_example_line_30 ... FAILED
42
thread 'main' panicked at 'CLI assertion failed: `echo 42` StdOut mismatch: expected to contain "42"
output=``````', src/assert.rs:316
note: Run with `RUST_BACKTRACE=1` for a backtrace.
test readme_sect_example_line_20 ... FAILED
ls: cannot access 'foo-bar-foo': No such file or directory
thread 'main' panicked at 'assertion failed: test.is_ok()', /tmp/rust-skeptic.jyzyW7R9Webs/test.rs:10
note: Run with `RUST_BACKTRACE=1` for a backtrace.
test readme_sect_example_line_41 ... FAILED
Activity
sevagh commentedon Oct 4, 2017
This would be a big help to me. Another thing could be setting environment variables. Like many people I have my own hacky wrapper around
std::process
and I rely on stdin and environment variables to test my binary properly:https://github.com/sevagh/pq/blob/master/tests/runner/mod.rs#L36
epage commentedon Oct 4, 2017
Would you be willing to get your
with_stdin
into a PR against assert_cli? I personally do not (yet) have opinions on the name (with_stdin
,stdin
,given_input
).Freyskeyd is looking at handling environment variables in #27. Feel free to jump on over there to see how well our current plan will handle your needs and provide feedback.
sevagh commentedon Oct 4, 2017
I'm running into some difficulty. It's as if
cwd
changed due to my changes:My changes:
master...sevagh:master
I have yet to write
stdin
-specific tests, I just happened to break the regular tests.epage commentedon Oct 4, 2017
Oye, that is frustratingly unclear from the documentation.
spawn
,output
, andstatus
all have different defaults when you don't explicitly set stdin/stdout/stderrYou have to pay close attention in the docs
I didn't notice until I went digging in the source code for
std::process::Command
andstd::sys::process
So you need
sevagh commentedon Oct 5, 2017
Thanks for the help. Here's the PR: #44
stdin
function #44