Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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.