feat(notify): notify-send effector with nop fallback

This commit is contained in:
2026-06-05 21:22:12 -04:00
parent aac3173874
commit 607ad74def
2 changed files with 67 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
// internal/notify/notify_test.go
package notify
import (
"context"
"testing"
)
// nopNotifier must be returned when notify-send is absent, and must never error.
func TestNopNotifierIsSilentAndSafe(t *testing.T) {
n := nopNotifier{}
if err := n.Notify(context.Background(), "title", "body"); err != nil {
t.Fatalf("nop Notify must return nil, got %v", err)
}
}
// NewNotifier always returns a usable Notifier (never nil), whatever the host.
func TestNewNotifierNeverNil(t *testing.T) {
if NewNotifier() == nil {
t.Fatal("NewNotifier returned nil")
}
}