https://github.com/peterdavehello/bu
an incomplete and simple tool for bash script unit test, as practice ...
https://github.com/peterdavehello/bu
bash script test unit-test
Last synced: 9 months ago
JSON representation
an incomplete and simple tool for bash script unit test, as practice ...
- Host: GitHub
- URL: https://github.com/peterdavehello/bu
- Owner: PeterDaveHello
- License: apache-2.0
- Created: 2016-01-03T09:09:35.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T17:29:54.000Z (about 2 years ago)
- Last Synced: 2025-02-13T08:22:56.192Z (11 months ago)
- Topics: bash, script, test, unit-test
- Language: Shell
- Homepage:
- Size: 60.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bu [](https://travis-ci.org/PeterDaveHello/bu)
simple tool for bash script unit test

## Usage
Put test scripts in a folder, then run:
```
BU_TESTS_PATH="path/of/folder/to/place/tests" /path/to/bu/bu_test.sh
```
## functions
### bu_assert
```sh
bu_assert "function or command to call" "expected result"
bu_assert "function or command to call" "expected result" "self defined error message"
```
### bu_assert_return
```sh
bu_assert_return "function or command to call" "expected exit code / return code"
bu_assert_return "function or command to call" "expected exit code / return code" "self defined error message"
```
### bu_todo_assert
```sh
bu_todo_assert "function or command to call, but not implmented or not finished yet" "expected result"
```
### bu_todo_assert_return
```sh
bu_todo_assert_return "function or command to call, but not implmented or not finished yet" "expected exit code / return code"
```