-
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.
- Loading branch information
1 parent
ef9a8b8
commit 3cf0dbb
Showing
5 changed files
with
42 additions
and
16 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 |
---|---|---|
|
@@ -8,14 +8,14 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, macos-11.0] | ||
os: [ubuntu-20.04, macos-10.15] | ||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- name: run the example test case on ubuntu | ||
if: startsWith(matrix.os, 'ubuntu') | ||
run: | | ||
source <(curl -sSf https://raw.githubusercontent.com/chiefbiiko/bashert/v1.0.1/bashert.sh) | ||
source <(curl -sSf https://raw.githubusercontent.com/chiefbiiko/bashert/v1.1.0/bashert.sh) | ||
source ./test_suite.sh | ||
test_users_list_200 | ||
|
@@ -24,4 +24,5 @@ jobs: | |
run: | | ||
source ./bashert.sh | ||
source ./test_suite.sh | ||
test_users_list_200 | ||
test_users_list_200 | ||
test_assert_files_equal |
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
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ assert_status ./curl_header_dump 204 | |
assert_equal twin twin | ||
assert_not_equal fraud fr@ud | ||
assert_match acab '^acab|ACAB$' | ||
assert_files_equal ./a ./b | ||
assert_files_equal_ignore_space ./a ./b | ||
assert_gt 419 255 | ||
assert_lt -1 0 | ||
|
@@ -28,17 +29,14 @@ use `lurc` instead of plain `curl` to require `TLS 1.2` for every connection and | |
|
||
## usage | ||
|
||
free 2 use however u like | ||
|
||
anyways, find my personal usage conventions illustrated below | ||
|
||
> obviously, this needs 2 run in `bash` and you probly also want tools like `curl` and `jq` available in that shell - fortunately, when using github actions `ubuntu-*` and `macos-*` runners we get `curl` and `jq` preinstalled amongst other things | ||
`touch` two files `test_suite.sh` and `.github/workflows/ci.yml` as below | ||
### `test_suite.sh` | ||
|
||
define a test case with a simple `bash` function declaration making use of the provided assertion helpers, fx: | ||
source `bashert.sh` from a local copy or via the network, then define test cases with simple `bash` function declarations making use of the provided assertion helpers, fx: | ||
|
||
```bash | ||
source <(curl -sSf https://raw.githubusercontent.com/chiefbiiko/bashert/v1.1.0/bashert.sh) | ||
|
||
test_users_list_200() { | ||
printf "test_users_list_200\n" | ||
|
||
|
@@ -65,22 +63,22 @@ test_users_list_200() { | |
} | ||
``` | ||
|
||
> `source`ing from a url like above only works on `ubuntu` runners | ||
### `.github/workflows/ci.yml` | ||
|
||
1. source `bashert.sh` from a local copy or via the network | ||
2. source your custom `test_suite.sh` | ||
3. call your `bash` test case functions | ||
1. source your custom `test_suite.sh` | ||
2. call your `bash` test case functions | ||
|
||
```bash | ||
steps: | ||
- uses: actions/[email protected] | ||
- run: | | ||
source <(curl -sSf https://raw.githubusercontent.com/chiefbiiko/bashert/v1.0.1/bashert.sh) | ||
source ./test_suite.sh | ||
test_users_list_200 | ||
``` | ||
|
||
> `source`ing from a url like above only works on `ubuntu` runners | ||
> obviously, this needs 2 run in `bash` and you probly also want tools like `curl` and `jq` available in that shell - fortunately, when using github actions `ubuntu-*` and `macos-*` runners we get `curl` and `jq` preinstalled amongst other things | ||
## license | ||
|
||
|
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
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