-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat: adds the missing assert_file_not_contains function #61
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR. Please add a test for when the file does not exist and document the desired behavior.
@martin-schulze-vireso That isn't a test that exists for I have a local Do you want me to rewrite both Edit: And that's actually my intention as an end user, in my |
My expectation would be that assert_file_(not_)contains tests for the file's existance as well, so it would be better to at least explicitly document this, better yet to check it: assert_file_contains implicitly fails if there is no file but assert_file_not_contains succeeds when the file does not exist. This means tests with typos in the filepath might succeed by accident. |
Got it, that makes sense. Would you prefer I invoke |
You can call it if the resulting backtrace still points to the call to assert_file_not_contains. |
What do you think of these changes? |
On the failed test - |
Done! |
Please sign your commits, this is the last missing step. |
Done! |
Thanks for your contribution(and patience). |
# Description ### Summary: Add logic to check if docker run is done on a teamcity server. Also add the missing bats-file function which was merged in PR #61 at bats-core/bats-file#61 --- # Checklist: ### Code related - [ ] I have made corresponding changes to the documentation (i.e.: function/class, script header, README.md) - [x] I have commented hard-to-understand code - [x] I have added tests that prove my fix is effective or that my feature works - [x] All tests pass locally with my changes (Check `tests/README.md` for local testing procedure) - [x] My commit messages follow the [conventional commits](https://www.conventionalcommits.org) specification. See `commit_msg_reference.md` in the repository root for details ### PR creation related - [x] My pull request `base ref` branch is set to the `dev` branch (the _build-system_ won't be triggered otherwise) - [x] My pull request branch is up-to-date with the `dev` branch (the _build-system_ will reject it otherwise) ### PR description related - [x] I have included a quick summary of the changes - [x] I have indicated the related issue's id with `# <issue-id>` if changes are of type `fix` ## Note for repository admins ### Release PR related - Only repository admins have the privilege to `push/merge` on the default branch (ie: `main`) and the `release` branch. - Keep PR in `draft` mode until all the release reviewers are ready to push the release. - Once a PR from `release` -> `main` branch is created (not in draft mode), it triggers the _build-system_ test - On merge to the `main` branch, it triggers the _semantic-release automation_
I needed to use this method and I noticed the open issue that it does not yet exist. Added the
assert_file_not_contains
method and tests that are basically just the exact opposities of theassert_file_contains
tests.