add test to check if tests are ran with sxmo_common.sh loaded
This test checks if our tests are being ran with sxmo_common.sh loaded Signed-off-by: Stacy Harper <contact@stacyharper.net>
This commit is contained in:

committed by
Stacy Harper

parent
2fd5957d49
commit
faf766cc43
@@ -3,6 +3,8 @@ packages:
|
||||
- shellcheck
|
||||
- editorconfig-checker
|
||||
- shellspec
|
||||
- gojq
|
||||
- jq
|
||||
sources:
|
||||
- https://git.sr.ht/~mil/sxmo-utils
|
||||
tasks:
|
||||
|
7
spec/helper/jq.sh
Normal file
7
spec/helper/jq.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# include common definitions
|
||||
# shellcheck source=scripts/core/sxmo_common.sh
|
||||
. sxmo_common.sh
|
||||
|
||||
jq -v | cut -d" " -f1
|
15
spec/scripts/core/sxmo_common_spec.sh
Normal file
15
spec/scripts/core/sxmo_common_spec.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
# shellcheck disable=SC2155
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright 2022 Sxmo Contributors
|
||||
|
||||
# This file is to investigate whether sxmo_common.sh is loaded in tests
|
||||
|
||||
Describe 'sxmo_common.sh'
|
||||
It 'runs all tests with sxmo_common.sh loaded'
|
||||
When call sh spec/helper/jq.sh
|
||||
The output should equal 'gojq'
|
||||
The status should be success
|
||||
End
|
||||
End
|
Reference in New Issue
Block a user