package notify import ( "os/exec" "testing" ) // hasNotifier reports whether a desktop notifier is installed, so tests can // avoid firing real notifications on developer machines. func hasNotifier() bool { for _, bin := range []string{"notify-send", "osascript"} { if _, err := exec.LookPath(bin); err == nil { return true } } return false } func TestSendWithoutNotifier(t *testing.T) { if hasNotifier() { t.Skip("a desktop notifier is installed; skipping to avoid firing notifications") } // Without a notifier, Send must be a silent no-op. if err := Send("gitflow test", "no notifier available"); err != nil { t.Errorf("Send: %v", err) } }