-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added bats container and makefile for bats testing
- Loading branch information
1 parent
1edd7bb
commit 2b3ee83
Showing
3 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM bats/bats:latest | ||
RUN apk add git | ||
RUN mkdir /opt/bats-test-helpers | ||
RUN git clone https://github.com/ztombol/bats-support /opt/bats-test-helpers/bats-support | ||
RUN git clone https://github.com/ztombol/bats-assert /opt/bats-test-helpers/bats-assert | ||
RUN git clone https://github.com/lox/bats-mock /opt/bats-test-helpers/lox-bats-mock | ||
WORKDIR /code/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# bats | ||
|
||
This folder contains the test harness for testing bash scripts. | ||
|
||
Inspired from : [Marck Oemar's Medium post](https://marck-oemar.medium.com/unusual-unit-testing-part-1-bash-scripts-with-bats-55ac78e61491) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
build_bats: | ||
docker build .github/tests/bats -t bats-with-helpers:latest | ||
|
||
test_bashscripts: build_bats | ||
docker run --rm -v "${PWD}/.github:/code" bats-with-helpers:latest /code/tests/ |