diff --git a/tests/git-manager/git_cmd.bats b/tests/git-manager/git_cmd.bats index 71cf848..ccf5ce1 100644 --- a/tests/git-manager/git_cmd.bats +++ b/tests/git-manager/git_cmd.bats @@ -109,6 +109,23 @@ setup() { [[ "$output" == *"== Repo: $REPO =="* ]] } +@test "a registered path that is a file, not a directory, errors" { + FILE_PATH="$BATS_TEST_TMPDIR/not-a-dir" + echo "just a file" > "$FILE_PATH" + write_git_manager_config "$CONFIG_FILE" "plain=$FILE_PATH" + run "$SCRIPT" status --repo plain + [ "$status" -eq 1 ] + [[ "$output" == *"is not a directory"* ]] +} + +@test "missing python3 fails with a clear error instead of a silent crash" { + write_git_manager_config "$CONFIG_FILE" "myrepo=$REPO" + hide_command python3 + run "$SCRIPT" status --repo myrepo + [ "$status" -eq 1 ] + [[ "$output" == *"python3 is required"* ]] +} + # --- -- passthrough --- @test "args after -- reach git unmodified" { diff --git a/tests/obsidian-vault-kb/vault_index.bats b/tests/obsidian-vault-kb/vault_index.bats index 5bb5ad4..1920e13 100644 --- a/tests/obsidian-vault-kb/vault_index.bats +++ b/tests/obsidian-vault-kb/vault_index.bats @@ -34,6 +34,15 @@ setup() { done } +@test "grep fallback still extracts tags when rg is unavailable" { + hide_command rg + run "$SCRIPT" v + [ "$status" -eq 0 ] + for tag in dns homelab networking overview; do + [[ "$output" == *"$tag"* ]] + done +} + @test "a note matching *overview* is flagged as a possible MOC file" { run "$SCRIPT" v [ "$status" -eq 0 ]