Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add more handling for undefined vars #18
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
base: master
Are you sure you want to change the base?
Add more handling for undefined vars #18
Changes from 2 commits
be0af42
80df450
03ecde5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Private variables (those starting with an underscore, which also isn't documented anywhere…) shouldn't be used directly in testing. Instead, you could try:
mktmp
call to return a known directory and verifying that directory is removedshpy.[0-9]+
, keeping in mind thatzsh
doesn't glob like other shellsIt's likely that
$_shpy_spies_dir
reflects the directory on disk, but it's best to check for the directory itself because that's what the end user would see 🔍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.
This can be removed, my upcoming PR runs all tests with nounset to ensure shpy runs under those stricter conditions
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.
This test is good, but you should remove the nounset and private variable references. You shouldn't have to remove the dir tree every time, if you add a teardown function you can more-or-less ensure the test slate is clean
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.
This should be removed, I set it globally for all tests in my upcoming PR