Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Improve `assert_have_been_called_with` with strict argument matching
- Make Windows install clearer in the docs by adding an option for Linux/Mac and another one for Windows.
- Add support for empty values and values containing spaces in data providers via new `data_set` function
- Document workaround for global function name collisions when sourcing scripts in tests by copying the original function

## [0.23.0](https://github.com/TypedDevs/bashunit/compare/0.22.3...0.23.0) - 2025-08-03

Expand Down
15 changes: 15 additions & 0 deletions docs/globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

You can use this list of global functions that exists to primarily to improve your developer experience.

::: warning
If you `source` a script in your tests that defines a function with the same
name as one of these globals (like `log`), your script will override bashunit's
version. To keep using bashunit's implementation, copy the original function
under a new name before sourcing and call that copy explicitly:

```bash
eval "bashunit_$(declare -f log)"
source script.sh
bashunit_log "this will be logged now"
```

The `eval` line duplicates `log` as `bashunit_log`, allowing you to call
`bashunit_log` even after `script.sh` redefines `log`.
:::

## log

Expand Down
Loading