diff --git a/.build.yml b/.build.yml index d763afe..97e8e89 100644 --- a/.build.yml +++ b/.build.yml @@ -3,6 +3,8 @@ packages: - shellcheck - editorconfig-checker - shellspec + - gojq + - jq sources: - https://git.sr.ht/~mil/sxmo-utils tasks: diff --git a/spec/helper/jq.sh b/spec/helper/jq.sh new file mode 100644 index 0000000..51b4f36 --- /dev/null +++ b/spec/helper/jq.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# include common definitions +# shellcheck source=scripts/core/sxmo_common.sh +. sxmo_common.sh + +jq -v | cut -d" " -f1 diff --git a/spec/scripts/core/sxmo_common_spec.sh b/spec/scripts/core/sxmo_common_spec.sh new file mode 100644 index 0000000..dddce58 --- /dev/null +++ b/spec/scripts/core/sxmo_common_spec.sh @@ -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