rename project to runaway

This commit is contained in:
2026-11-09 10:13:51 +08:00
parent 5857081832
commit c9feb8c05a
95 changed files with 1034 additions and 1034 deletions
+10 -10
View File
@@ -4,7 +4,7 @@ run_cli() {
local script="$1"; shift
local definitions="$BATS_TEST_TMPDIR/${script##*/}.functions"
sed '/^main "\$@"$/d' "$script" > "$definitions"
run "${UNLEASH_TEST_SHELL:-bash}" -u -c '
run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
source "$1"
shift
load_config() { :; }
@@ -19,7 +19,7 @@ run_capture() {
local script="$1"; shift
local definitions="$BATS_TEST_TMPDIR/${script##*/}.functions"
sed '/^main "\$@"$/d' "$script" > "$definitions"
run "${UNLEASH_TEST_SHELL:-bash}" -u -c '
run "${RUNAWAY_TEST_SHELL:-bash}" -u -c '
source "$1"
shift
load_config() { :; }
@@ -33,7 +33,7 @@ run_capture() {
@test "optional CLI arguments reach usage or privilege guards under nounset" {
local entrypoint
for entrypoint in unleash unleash-standalone.sh; do
for entrypoint in runaway runaway-standalone.sh; do
local script="$BATS_TEST_DIRNAME/../$entrypoint"
run_cli "$script" audit
[ "$status" -ne 0 ]; [[ "$output" == *"Audit needs sudo"* ]]
@@ -42,15 +42,15 @@ run_capture() {
run_cli "$script" monitor --webhook
[ "$status" -ne 0 ]; [[ "$output" == *"--webhook requires a URL"* ]]
run_cli "$script" config set
[ "$status" -ne 0 ]; [[ "$output" == *"Usage: ./unleash config set KEY VALUE"* ]]
[ "$status" -ne 0 ]; [[ "$output" == *"Usage: ./runaway config set KEY VALUE"* ]]
run_cli "$script" config unset
[ "$status" -ne 0 ]; [[ "$output" == *"Usage: ./unleash config unset KEY"* ]]
[ "$status" -ne 0 ]; [[ "$output" == *"Usage: ./runaway config unset KEY"* ]]
done
}
@test "CLI values retain spaces quotes empty strings and literal shell syntax" {
local entrypoint value
for entrypoint in unleash unleash-standalone.sh; do
for entrypoint in runaway runaway-standalone.sh; do
for value in 'a b $(printf injected) "quoted"' ''; do
run_capture "$BATS_TEST_DIRNAME/../$entrypoint" config set LOG_FILE "$value"
[ "$status" -eq 0 ]
@@ -63,7 +63,7 @@ run_capture() {
@test "global flags around the command persist in the command shell" {
local entrypoint
for entrypoint in unleash unleash-standalone.sh; do
for entrypoint in runaway runaway-standalone.sh; do
run_capture "$BATS_TEST_DIRNAME/../$entrypoint" --dry-run config --verbose set LOG_FILE value --log-file 'a b.log'
[ "$status" -eq 0 ]
[[ "$output" == 'dry=true verbose=true log=<a b.log>'* ]]
@@ -73,7 +73,7 @@ run_capture() {
@test "global flags without a command preserve an empty argument list" {
local entrypoint
for entrypoint in unleash unleash-standalone.sh; do
for entrypoint in runaway runaway-standalone.sh; do
run_cli "$BATS_TEST_DIRNAME/../$entrypoint" --verbose
[ "$status" -eq 0 ]
[ "$output" = 'interactive verbose=true' ]
@@ -82,7 +82,7 @@ run_capture() {
@test "CLI option terminator preserves values that look like global options" {
local entrypoint
for entrypoint in unleash unleash-standalone.sh; do
for entrypoint in runaway runaway-standalone.sh; do
run_capture "$BATS_TEST_DIRNAME/../$entrypoint" config set LOG_LEVEL -- --verbose
[ "$status" -eq 0 ]
[[ "$output" == 'dry=false verbose=false log=<>'* ]]
@@ -92,7 +92,7 @@ run_capture() {
@test "log-file rejects an empty path or another option as its missing value" {
local entrypoint value
for entrypoint in unleash unleash-standalone.sh; do
for entrypoint in runaway runaway-standalone.sh; do
for value in '' --dry-run; do
run_cli "$BATS_TEST_DIRNAME/../$entrypoint" --log-file "$value" version
[ "$status" -ne 0 ]