Release 0.29.0
🔧 New features
Namespaced internal functions
All internal functions and variables are now prefixed with bashunit:: to prevent naming collisions with your code:
skip "reason"
helper::trim "$value"bashunit::skip "reason"
bashunit::helper::trim "$value"Internal variables are also prefixed: _TESTS_PASSED becomes _BASHUNIT_TESTS_PASSED. The public API (assert_* functions) remains unchanged.
Bootstrap argument passing
Pass arguments to your bootstrap script using the --env flag:
bashunit --env "bootstrap.sh arg1 arg2" tests/BASHUNIT_BOOTSTRAP_ARGS="arg1 arg2" bashunit tests/Login shell support
Run tests in a login shell context with the new -l, --login flag:
bashunit --login tests/This loads your shell profile, useful when testing scripts that depend on login shell configuration.
Strict mode
Enable strict shell mode (set -euo pipefail) for your tests:
bashunit --strict tests/BASHUNIT_STRICT_MODE=trueStrict mode catches unset variables and pipeline failures, helping you write more robust scripts.
Run all assertions
Override the default stop-on-failure behavior with -R, --run-all:
bashunit --run-all tests/Standalone assert subcommand
Use assertions directly from the command line:
bashunit assert equals "expected" "actual"
bashunit assert contains "needle" "haystack"🐛 Bug fixes
- Custom assertions now display correct test function name in failure messages
- Data providers work when
set_up_before_scriptchanges directory - Resolved race conditions in parallel test execution
- Test doubles are now strict mode compatible
- Catch intermediate failing commands in
set_up_before_scriptandtear_down_after_script
🌾 Miscellaneous
- Improved
assertcommand output: showsassert <fn>instead of internal function name --preserve-envoption to skip.envloading and use shell environment only
See the full changelog on GitHub