1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-23 00:15:08 +00:00

Improve update checks and cleanup UX, add timeout regressions

This commit is contained in:
tw93
2026-03-05 12:00:07 +08:00
parent fbee8da9f7
commit 8e4b8a5e0d
21 changed files with 948 additions and 164 deletions

View File

@@ -14,7 +14,7 @@ setup_file() {
}
teardown_file() {
rm -f "$PROJECT_ROOT/install_channel"
rm -rf "$HOME/.config/mole"
rm -rf "$HOME"
if [[ -n "${ORIGINAL_HOME:-}" ]]; then
export HOME="$ORIGINAL_HOME"
@@ -46,9 +46,8 @@ SCRIPT
}
setup() {
rm -rf "$HOME/.config"
mkdir -p "$HOME"
rm -f "$PROJECT_ROOT/install_channel"
rm -rf "$HOME/.config/mole"
mkdir -p "$HOME/.config/mole"
}
@test "mole --help prints command overview" {
@@ -67,7 +66,8 @@ setup() {
@test "mole --version shows nightly channel metadata" {
expected_version="$(grep '^VERSION=' "$PROJECT_ROOT/mole" | head -1 | sed 's/VERSION=\"\(.*\)\"/\1/')"
cat > "$PROJECT_ROOT/install_channel" <<'EOF'
mkdir -p "$HOME/.config/mole"
cat > "$HOME/.config/mole/install_channel" <<'EOF'
CHANNEL=nightly
EOF
@@ -83,6 +83,12 @@ EOF
[[ "$output" == *"Unknown command: unknown-command"* ]]
}
@test "mole uninstall --whitelist returns unsupported option error" {
run env HOME="$HOME" "$PROJECT_ROOT/mole" uninstall --whitelist
[ "$status" -ne 0 ]
[[ "$output" == *"Unknown uninstall option: --whitelist"* ]]
}
@test "touchid status reports current configuration" {
run env HOME="$HOME" "$PROJECT_ROOT/mole" touchid status
[ "$status" -eq 0 ]