Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 853 Bytes

File metadata and controls

38 lines (28 loc) · 853 Bytes

Bach Testing Framework Homebrew Tap

This is the official Homebrew tap for the Bach Testing Framework.

Installation

brew tap bach-sh/tap
brew install bach

Or, install directly with a single command:

brew install bach-sh/tap/bach

Usage

The 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.