https://github.com/timgluz/asdf-bats
ASDF plugin for BATS bash unittest library
https://github.com/timgluz/asdf-bats
asdf asdf-bats asdf-plugin asdf-vm testing-tools unittest-library
Last synced: 5 months ago
JSON representation
ASDF plugin for BATS bash unittest library
- Host: GitHub
- URL: https://github.com/timgluz/asdf-bats
- Owner: timgluz
- License: mit
- Created: 2020-12-23T13:03:23.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-03-30T16:29:05.000Z (about 2 years ago)
- Last Synced: 2026-01-13T06:58:44.807Z (6 months ago)
- Topics: asdf, asdf-bats, asdf-plugin, asdf-vm, testing-tools, unittest-library
- Language: Shell
- Homepage:
- Size: 20.5 KB
- Stars: 7
- Watchers: 1
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# asdf-bats
[ASDF](https://asdf-vm.com/#/core-manage-asdf) plugin for the [BATS](https://github.com/bats-core/bats-core/), a unittest library for the Bash/Zsh;
### Install
```
asdf plugin-add bats https://github.com/timgluz/asdf-bats.git
asdf list all bats
asdf install bats 1.6.0
bats --version
```
### Contributing
* Open Github issue, describe the issue and propose a solution;
It helps others to see your progress and will avoid duplicated effort;
* Clone repo
* Apply Changes
* Test - make test
Test are written using [Bats](https://github.com/bats-core/bats-core) - you can use this plugin, use Docker or use `npm install -g bats`
running all the test: `bats tests/`
running a single file: `./list-all.sh`
```
# if you want to run it on docker
make run
export PLUGIN_URL="https://github.com/timgluz/asdf-bats.git"
# testing specific Github ref - good for reporting a bug
export PLUGIN_GITREF="5dce6968ce77db4ed220d815a99ccd501f82c383"
asdf plugin test bats $PLUGIN_URL --asdf-plugin-gitref $PLUGIN_GITREF bats --version
# testing a spec version, branch
export PLUGIN_VERSION="master"
asdf plugin test bats $PLUGIN_URL --asdf-tool-version $PLUGIN_VERSION bats --version
```
### Testing on Ubuntu
`Dockerfile.ubuntu_zsh` builds a docker image where the`asdf`is already preinstalled
and source-code of plugin copied to the asdf's plugin folder;
Example usage:
```
make build-ubuntu
make run-ubuntu
# check current version of asdf
asdf version
# check currently installed plugins
asdf list
# check available versions
asdf list all bats
# install Bats
asdf install bats v1.2.1
bats --version
exit
make clean-ubuntu
```