Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fredrkl/bats-core-demo
Bats core demo for Bash TDD
https://github.com/fredrkl/bats-core-demo
bash tdd
Last synced: about 1 month ago
JSON representation
Bats core demo for Bash TDD
- Host: GitHub
- URL: https://github.com/fredrkl/bats-core-demo
- Owner: fredrkl
- License: mit
- Created: 2024-02-18T20:32:04.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-02-20T07:15:33.000Z (12 months ago)
- Last Synced: 2025-01-02T23:53:36.009Z (about 1 month ago)
- Topics: bash, tdd
- Language: Shell
- Homepage: https://bats-core.readthedocs.io/
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bats Core TDD demo
This is a demo of how to use Bats to do TDD. Bash is a powerful language, but it's also easy to make mistakes. Bats is a testing framework that makes it easy to write tests for your bash scripts.
## Getting started
First, you need to install Bats: https://bats-core.readthedocs.io/en/stable/installation.html
## Notes
When working with arrays in bash you need to be careful. Bash does not nativly support returning arrays from functions. The `Array length test` in `./test/test.bats` shows a test example that could easily break should any of the elements in `generate_array` contain a ' ' character.