mbland / go-script-bash

Framework for writing modular, discoverable, testable Bash scripts
ISC License
95 stars 16 forks source link

Extract `lib/bats/function` from `lib/bats/assertions` #156

Closed mbland closed 7 years ago

mbland commented 7 years ago

While working on tests for the forthcoming ./go new command to address #142, I added a new @go.test_compgen helper in lib/testing/environment to replace the use of hand-written while loops to generate @go.compgen test data. In the process, I used set "$BATS_ASSERTION_DISABLE_SHELL_OPTIONS and return_from_bats_assertion to make the function faster than a hand-written loop, and realized that the mechanism could be applied to all Bats helper functions, potentially shaving a substantial amount of time off of the total build.

After merging the forthcoming PRs for @go.test_compgen and ./go new, I'll get to work on another PR to extract lib/bats/function and close this issue.