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:
Anjandev Momi
2022-04-17 01:49:36 -04:00
committed by Stacy Harper
parent 2fd5957d49
commit faf766cc43
3 changed files with 24 additions and 0 deletions

View File

@@ -3,6 +3,8 @@ packages:
- shellcheck - shellcheck
- editorconfig-checker - editorconfig-checker
- shellspec - shellspec
- gojq
- jq
sources: sources:
- https://git.sr.ht/~mil/sxmo-utils - https://git.sr.ht/~mil/sxmo-utils
tasks: tasks:

7
spec/helper/jq.sh Normal file
View 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

View 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