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

test(core): fix shellcheck warnings in common bats

This commit is contained in:
Tw93
2026-03-21 07:18:28 +08:00
parent 78fe1d124a
commit 546a5a292f

View File

@@ -84,7 +84,10 @@ EOF
} }
@test "should_protect_path protects Mole runtime logs" { @test "should_protect_path protects Mole runtime logs" {
result="$(HOME="$HOME" bash --noprofile --norc -c "source '$PROJECT_ROOT/lib/core/common.sh'; should_protect_path '$HOME/Library/Logs/mole/operations.log' && echo protected || echo not-protected")" result="$(
HOME="$HOME" PROJECT_ROOT="$PROJECT_ROOT" bash --noprofile --norc -c \
'source "$PROJECT_ROOT/lib/core/common.sh"; should_protect_path "$HOME/Library/Logs/mole/operations.log" && echo protected || echo not-protected'
)"
[ "$result" = "protected" ] [ "$result" = "protected" ]
} }
@@ -241,7 +244,7 @@ EOF
PATH="$fake_bin:$PATH" PROJECT_ROOT="$PROJECT_ROOT" HOME="$HOME" \ PATH="$fake_bin:$PATH" PROJECT_ROOT="$PROJECT_ROOT" HOME="$HOME" \
/usr/bin/script -q /dev/null /bin/bash --noprofile --norc -c \ /usr/bin/script -q /dev/null /bin/bash --noprofile --norc -c \
'source "$PROJECT_ROOT/lib/core/common.sh"; start_inline_spinner "Testing..."; /bin/sleep 0.15; stop_inline_spinner' \ "source \"\$PROJECT_ROOT/lib/core/common.sh\"; start_inline_spinner \"Testing...\"; /bin/sleep 0.15; stop_inline_spinner" \
> /dev/null 2>&1 > /dev/null 2>&1
[ ! -f "$marker" ] [ ! -f "$marker" ]