Add assertions for files and directories
ddidier opened this issue · comments
David DIDIER commented
A very useful project, thank you.
Some new assertions to consider:
- assertFileExists
- assertFileDoesNotExist
- assertFileContains
- assertFileDoesNotContain
- assertDirectoryExists
- assertDirectoryDoesNotExist
David DIDIER commented
See pull request #115
Chris Bandy commented
test
supports many expressions. Why single these few out?
The recently added failFound
and failNotFound
might be what you're looking for:
[ -f want ] || failNotFound want
[ ! -f dont ] || failFound dont
grep -q needle /haystack || failNotFound ...
David DIDIER commented
I didn't see this pattern, but I believe the ones I added are more readable (and I use them often).