Files
runaway/tests/test_recovery_download.bats

14 lines
555 B
Bash

#!/usr/bin/env bats
@test "Recovery download runs without a library directory" {
local repo="$BATS_TEST_DIRNAME/.." artifact target="$BATS_TEST_TMPDIR/recovery"
artifact=$(sed -n 's|^curl -L https://git.jskdjs.cn/ruihan/runaway/raw/branch/main/\([^ ]*\) -o /tmp/runaway$|\1|p' "$repo/README.md")
[ -n "$artifact" ]
mkdir -p "$target"
cp "$repo/$artifact" "$target/runaway"
run env HOME="$target" XDG_CONFIG_HOME="$target/config" bash "$target/runaway" version
[ "$status" -eq 0 ]
[[ "$output" == *"runaway"* ]]
[ ! -d "$target/lib" ]
}