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
README.md: more examples of (mis)using run #366
Conversation
Nice. I think that ties in well with #358. |
@sublimino PTAL |
Really nice work! These clear, simply stated documentation changes make the basics much easier for newcomers to bats, thanks @kolyshkin! You mentioned above:
I use |
Wow, I think this closes #1. |
With the discussion going on in #367, I would want to wait for a decision there, to avoid landing this and making it obsolete in the next step. |
@martin-schulze-vireso good point, I missed that one somehow! Will have a look over the weekend. It could be worth merging this so there's a baseline to extend upon with #367, but don't mind either way. |
Just noticed that the above PR already tried to document some of this. We should
|
@kolyshkin Now that #367 has landed (although the exact syntax is not settled #479), how much of this PR should we retain? We should also consider that #467 will offer switches to alter the output behavior of |
I agree that (once we settle on "run with exit code check" syntax) this needs to be revised, as now there are more ways to achieve the same result. Yet I think the documentation removal in #367 (e.g. ae26797#diff-12cfeed9f9b1cc83679dd5e693fdf109f2080614ae71c90466cace54a187082dL54) is a mistake. Instead, it should have been modified to show how to check exit codes. For example, writing run command args ...
echo "$output"
[ "$status" -eq 0 ] (the first example from the removed doc) is OK but not a good style; either |
@kolyshkin You're right. I removed that part and intended to add new documentation for it but never did. We'll let this reminder sit here until we settled on the syntax. |
@kolyshkin Would you mind having another stab at this? The |
@kolyshkin I did not hear back from you. Do you plan to work on this again? |
e0e13c3
to
0023c09
Compare
I reworked this according to the new
|
0023c09
to
683bdb3
Compare
c59d147
to
70dc56f
Compare
@martin-schulze-vireso thank you, I was just checking bats-core docs and was glad to see these examples. Sorry for not following up on this myself. |
@martin-schulze-vireso I would also appreciate adding "Co-authored-by" footer next time 😉 |
You mean in the commit message? I am sorry that this got swept away in the many revisions this has undergone. Usually I can rely on rebase to preserve this. |
This is a followup to #343 and closes #377.
After fixing some more code that uses
run
left and right, I am coming backto further improve its documentation.
In particular, I try to emphasize the only use case for run (checking the output
of a command that exits with non-zero status).
I also provide a non-working example of using run with pipes.