test(polecat): skip beads-unavailable test when bd is installed (#244)

TestGetReturnsWorkingWithoutBeads assumes bd is not available and
expects state to default to StateWorking. When bd is installed, it
actually queries beads and returns the real state, causing the test
to fail.

Skip the test when bd is detected to avoid environment-dependent
failures.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Julian Knutsen
2026-01-07 20:41:34 -08:00
committed by GitHub
parent 92042d679c
commit ffa8dd56cb

View File

@@ -2,6 +2,7 @@ package polecat
import ( import (
"os" "os"
"os/exec"
"path/filepath" "path/filepath"
"testing" "testing"
@@ -144,6 +145,13 @@ func TestAssigneeID(t *testing.T) {
func TestGetReturnsWorkingWithoutBeads(t *testing.T) { func TestGetReturnsWorkingWithoutBeads(t *testing.T) {
// When beads is not available, Get should return StateWorking // When beads is not available, Get should return StateWorking
// (assume the polecat is doing something if it exists) // (assume the polecat is doing something if it exists)
//
// Skip if bd is installed - the test assumes bd is unavailable, but when bd
// is present it queries beads and returns actual state instead of defaulting.
if _, err := exec.LookPath("bd"); err == nil {
t.Skip("skipping: bd is installed, test requires bd to be unavailable")
}
root := t.TempDir() root := t.TempDir()
polecatDir := filepath.Join(root, "polecats", "Test") polecatDir := filepath.Join(root, "polecats", "Test")
if err := os.MkdirAll(polecatDir, 0755); err != nil { if err := os.MkdirAll(polecatDir, 0755); err != nil {