bats
bats copied to clipboard
added example of piping commands together with run
+1
I had to tackle the same issue and I have resorted to the following:
run wc -l <(foo)
In my opinion, this way you have less problems with quoting
In this particular case yes. But in general good to document how to run with pipes.
Verstuurd door Outlook voor Android
On Sat, Oct 10, 2015 at 2:35 AM -0700, "Roman Savelyev" [email protected] wrote: I had to tackle the same issue and I have resorted to the following:
run wc -l <(foo)
In my opinion, this way you have less problems with quoting
Reply to this email directly or view it on GitHub: https://github.com/sstephenson/bats/pull/47#issuecomment-147069207
Thanks for opening this PR. It was helpful
you're welcome :-) also see https://github.com/rianwouters/bexpect :-)
groetjes,
Rian
Date: Sun, 20 Dec 2015 21:05:05 -0800 From: [email protected] To: [email protected] CC: [email protected] Subject: Re: [bats] added example of piping commands together with run (#47)
Thanks for opening this PR. It was helpful
— Reply to this email directly or view it on GitHub.
After reading through the original issue (https://github.com/sstephenson/bats/issues/10#issuecomment-26627687), I decided to avoid using run
altogether. It just sets the special variables $output
and $status
, both of which are easily available. Here's an example: https://github.com/jch/jsg/blob/a960847b03c9de392f30b112d2c7ab2591608a6e/test/bin/jsg_markdown_test.sh#L4-L5