diff --git a/stations_test.go b/stations_test.go index 832c8aa..4c33ed2 100644 --- a/stations_test.go +++ b/stations_test.go @@ -8,6 +8,8 @@ import ( "strings" "testing" + "github.com/gmgauthier/gostations/internal/config" + playerpkg "github.com/gmgauthier/gostations/internal/player" "github.com/gmgauthier/gostations/internal/radio" ver "github.com/gmgauthier/gostations/internal/version" ) @@ -82,6 +84,14 @@ func TestPrecheck_Unit(t *testing.T) { t.Parallel() t.Log("✓ Fast precheck unit test") + p := "mpv" + if v, err := config.Get("player.command"); err == nil && v != "" { + p = v + } + if !playerpkg.IsInstalled(p) { + t.Skipf("%s is either not installed, or not on your $PATH; skipping real precheck() call in unit test (see TestPrecheck_Live)", p) + } + // Simple smoke test — calls the real precheck() in the common "player installed" path // (no mocking of globals — that's not allowed in Go) precheck()