Add plugin scope tests, new test helper, other related improvements #133
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.
Closes #132. Adds test cases missing from #131.
As demonstrated by the "plugin subcommand finds correct command in own plugin" test case, not setting
_GO_SCRIPTS_DIRcorrectly for a plugin could've caused serious bugs:In the process of writing these tests, I made some other improvements along the way which are well-documented in the commit messages. At a high level:
/plugins/appears in_GO_ROOTDIR, in_GO_SCRIPTS_DIR, in the command script path relative to_GO_SCRIPTS_DIR, or in one or more combined. While such cases would be pathological, it was easy to handle them../go commandsno longer insists there be no duplicate script names, in light of_GO_SEARCH_PATHSand the role it plays in the plugin model.fail_if line_*now prints the full output on error, just as if the correspondingassert_line_*function failed.test_break_after_num_iterationsfunction tolib/bats/helpers, and hit yet another obscure Bash bug in the process (Bash <4.4 doesn't set theBASH_SOURCEentry for themainscript.