Skip to content
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

Add assertions for files and directories #114

Open
ddidier opened this issue Feb 14, 2019 · 3 comments
Open

Add assertions for files and directories #114

ddidier opened this issue Feb 14, 2019 · 3 comments

Comments

@ddidier
Copy link

ddidier commented Feb 14, 2019

A very useful project, thank you.
Some new assertions to consider:

  • assertFileExists
  • assertFileDoesNotExist
  • assertFileContains
  • assertFileDoesNotContain
  • assertDirectoryExists
  • assertDirectoryDoesNotExist
@ddidier ddidier changed the title Add assertions for files and directory Add assertions for files and directories Feb 14, 2019
@ddidier
Copy link
Author

ddidier commented Feb 14, 2019

See pull request #115

@cbandy
Copy link

cbandy commented Feb 18, 2019

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 ...

@ddidier
Copy link
Author

ddidier commented Feb 18, 2019

I didn't see this pattern, but I believe the ones I added are more readable (and I use them often).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants