shellcheck improvements for bats tests

This commit is contained in:
Jérémy Lecour 2020-04-08 16:49:27 +02:00 committed by Jérémy Lecour
parent e5997400cd
commit e1208ed2b8
6 changed files with 17 additions and 0 deletions

View File

@ -63,6 +63,16 @@ the *test* provision :
vagrant provision --provision-with test
~~~
You can also run the tests from inside the VM
~~~
localhost $ vagrant ssh test
vagrant@test $ sudo -i
root@test # bats /vagrant/test/*.bats
~~~
You should shellcheck your bats files, but with shellcheck > 0.4.6, because the 0.4.0 version doesn't support bats syntax.
## Usage
See [docs/usage.md](docs/usage.md).

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bats
# shellcheck disable=SC1089,SC1083,SC2154
load test_helper

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bats
# shellcheck disable=SC1089,SC1083,SC2154
load test_helper

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bats
# shellcheck disable=SC1089,SC1083,SC2154
load test_helper

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bats
# shellcheck disable=SC1089,SC1083,SC2154
load test_helper

View File

@ -1,4 +1,6 @@
# shellcheck disable=SC2154 shell=bash
# shellcheck disable=SC2034
setup() {
. /usr/lib/bkctld/includes
@ -121,6 +123,7 @@ refute_line() {
fi
}
# shellcheck disable=SC2145
assert() {
if ! "$@"; then
flunk "failed: $@"