-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distinction between Assert::set_stdin()
and with_stdin
is confusing
#29
Comments
#[test]
fn broek_dep() {
Command::new("cat")
.assert()
.set_stdin(vec![0])
.stdout("\0")
.success();
} Are you converting over from So that I can see how this isn't letting people fall into the pit of success. Any ideas for better names or other means to help people use the right function and avoid the one more so meant for internal purposes (but is |
Assert::set_stdin()
doesn't seem to workAssert::set_stdin()
and with_stdin
is confusing
No, but I've found out about
I think that having something like a bold Warning in the documentation of the function explaining that this might not be what they want and recommending using |
Forgot to reply to:
Please open a distinct issue for this |
Documentation just patches over problems and only helps so far as it is read (e.g. the current documentation already pretty clearly states how the parameter to I'm considering things like
|
While the documentation for `set_stdin` and `with_stdin` is clear, we can't expect everyone to read the documentation closely. This attempts to make the API harder to misuse so users can be more successful. BREAKING CHANGE: `Assert::set_cmd` and `Assert::set_stdin` have been replaced with `Assert::append_context`. Fixes assert-rs#29
While the documentation for `set_stdin` and `with_stdin` is clear, we can't expect everyone to read the documentation closely. This attempts to make the API harder to misuse so users can be more successful. BREAKING CHANGE: `Assert::set_cmd` and `Assert::set_stdin` have been replaced with `Assert::append_context`. Fixes assert-rs#29
No idea if it doesn't actually work, or if I'm doing something wrong and API is simply allowing for it, but either way it should be fixed.
assert_cmd = "0.6"
my test case:
Which results in:
Also on a side note, output of
assert_cmd
when there's an error is rather confusing and not helpful when you're trying to deal with input/output that consists of raw, often unprintable, bytes.Debug
output without additional ``` would work a lot better IMO.The text was updated successfully, but these errors were encountered: