prole/tests/shellspec/.vendor/shellspec-0.28.1/spec/shellspec-gen-bin_spec.sh
chrisfu 909e92109e Refactor shell layout; add shellspec + authority
- Introduce lib/shell helpers and keep etc/* scripts thin via compatibility shims

- Move Kerberos validation to scripts/validation/check_kerberos.sh and update callers

- Add deterministic shellspec unit tests under tests/shellspec/ and wire Maven to run them

- Add minimal Spring Boot authority module with startup + /health endpoint and Maven wiring

- Document the new layout in docs/layout.md

Co-authored-by: Junie <junie@jetbrains.com>
2026-03-13 09:19:56 -07:00

59 lines
1.6 KiB
Bash

#shellcheck shell=sh disable=SC2016
% GENBIN: "$SHELLSPEC_TMPBASE/gen-bin"
% HELPERDIR: "$SHELLSPEC_TMPBASE/gen-bin/spec"
Describe "run shellspec-gen-bin.sh"
# shellcheck disable=SC2034
__main__() {
SHELLSPEC_HELPERDIR="$HELPERDIR"
SHELLSPEC_COLOR=''
SHELLSPEC_SUPPORT_BINDIR="$HELPERDIR/support/bin"
}
Intercept main
Path dummy-bin="$HELPERDIR/support/bin/@dummy"
Context "when spec directory exists"
Skip if "tmp directory is not executable" noexec_tmpdir
setup() { @mkdir -p "$HELPERDIR"; }
Before setup
cleanup() { @rm -rf "$GENBIN"; }
After cleanup
mkdir() { @mkdir "$@"; }
chmod() { @chmod "$@"; }
It 'generates support bin'
When run source ./libexec/shellspec-gen-bin.sh "@dummy"
The output should start with "Generate @dummy"
The file dummy-bin should be executable
End
End
Context "when spec directory not exists"
It 'raises error'
When run source ./libexec/shellspec-gen-bin.sh "@dummy"
The error should eq "shellspec helper directory not found: $HELPERDIR"
The file dummy-bin should not be exist
The status should be failure
End
End
Context "when spec support bin already exists"
setup() {
@mkdir -p "$HELPERDIR/support/bin"
@touch "$HELPERDIR/support/bin/@dummy"
}
Before setup
mkdir() { @mkdir "$@"; }
It 'skips generate support bin'
When run source ./libexec/shellspec-gen-bin.sh "@dummy"
The error should start with "Skip, @dummy already exist"
The file dummy-bin should be exist
End
End
End