This is the official Homebrew tap for the Bach Testing Framework.
brew tap bach-sh/tap
brew install bachOr, install directly with a single command:
brew install bach-sh/tap/bachThe bach formula provides the bach.sh testing framework script. This script is not meant to be used directly in your interactive shell; it should be sourced from within your Bash test files.
For example, create a test file my_tests.sh:
#!/usr/bin/env bash
source bach.sh
test-example() {
@mock id -u === @out 0
if [[ "$(id -u)" -eq 0 ]]; then
ls /root
fi
}
test-example-assert() {
ls /root
}When you run bash my_tests.sh, the Bach testing framework will automatically discover and run your tests, producing TAP-compliant output.