https://github.com/toddbaert/shellot
A gherkin framework for bash
https://github.com/toddbaert/shellot
bash cucumber gherkin integration shell shell-script testing
Last synced: about 2 months ago
JSON representation
A gherkin framework for bash
- Host: GitHub
- URL: https://github.com/toddbaert/shellot
- Owner: toddbaert
- License: mit
- Created: 2022-10-30T20:23:40.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-10T17:49:11.000Z (over 3 years ago)
- Last Synced: 2025-03-27T16:52:29.680Z (over 1 year ago)
- Topics: bash, cucumber, gherkin, integration, shell, shell-script, testing
- Language: Shell
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## What is this?
_shellot_ is a simple gherkin testing framework. It's written in bash, as the tests you write for it are also just bash.
This is a work in progress so expect frequent improvements!
## How do I use it?
Run it like: `./libexec/shellot -f thing.feature -t thing-test.sh`, where `thing.feature` is a gherkin file and `thing-test.sh` is an implementing test file.
Tests are written in bash, and must return 0/1 to indicate success/failure. Tests must be registered by calling the `step` function with their associated gherkin expression as the first parameter, and the test function as the second:
```shell
#!/usr/bin/env bash
When "([0-9]+) and ([0-9]+) are added" sum_when
Then "the result is ([0-9]+)" sum_then
declare sum
function sum_when () {
sum=$(( $1 + $2 ))
}
function sum_then () {
if [[ $1 -eq $sum ]]; then
return 0
else
return 1
fi
}
```
Samples can be found under the `samples/` folder.