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

Comments

Projects
None yet
2 participants
@ddidier
Copy link

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

This comment has been minimized.

Copy link
Author

commented Feb 14, 2019

See pull request #115

@cbandy

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Author

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
You can’t perform that action at this time.