Open edouard-lopez opened 7 years ago
@edouard-lopez could you try with run eval "{INSERT_QUERY_WITH_PIPES}"
:
run eval "ls foobar | grep foo"
[ "$status" -eq 0 ]
Thanks @sayanee, however I'm looking for some best practices to write my script to help me tests them.
Hi,
I'm looking for ways to test my scripts, some patterns you use/recommend. For instance, how would you test a script such as this one:
How do I check I have been
cd
to the correct directory?Currently I stub
cd
to check how it's call.But then the script continue to run everything after that.
How to test a pipe?
or
What would you test and how? Is it possible to test part of the pipe?
How would you check value of an env var
How would you chek that we use globstar?
related: stackexchange question