prole/tests/shellspec/.vendor/shellspec-0.28.1/spec/libexec/task_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
Describe "libexec/binary.sh"
Include "$SHELLSPEC_LIB/libexec/task.sh"
Describe "task()"
It 'registers task'
BeforeCall SHELLSPEC_TASK_SOURCE="test_task.sh"
BeforeCall 'task "dummy:task" "Dummy task"'
When call task "test:task" "Test task"
The variable SHELLSPEC_TASKS should eq "dummy:task test:task"
The variable SHELLSPEC_TASK_test_task should eq "test_task.sh"
The variable SHELLSPEC_TASK_DESC_test_task should eq "Test task"
End
End
Describe "enum_tasks()"
setup() {
SHELLSPEC_TASK_SOURCE="test_task1.sh"
task "test:task1" "Task1"
SHELLSPEC_TASK_SOURCE="test_task2.sh"
task "test:task2" "Task2"
SHELLSPEC_TASK_SOURCE="test_task3.sh"
task "test:task3" "Task3"
}
Before setup
callback() { echo "$@"; }
It 'enumerates tasks'
When call enum_tasks callback
The line 1 of stdout should eq "test:task1 Task1"
The line 2 of stdout should eq "test:task2 Task2"
The line 3 of stdout should eq "test:task3 Task3"
End
End
Describe "invoke()"
setup() {
# shellcheck disable=SC2034
SHELLSPEC_TASK_SOURCE="test_task.sh"
task "test:task" "Task"
}
Before setup
cat() { echo "test_task_task() { echo ok; }"; }
It 'invokes tasks'
When call invoke "test:task"
The stdout should eq "ok"
End
It 'aborts with invalid task name'
When run invoke "test:no-task"
The stderr should include 'Not found task'
The stderr should include 'test:no-task'
The status should be failure
End
End
End