From f288310b7adf9775e405f251eb4920969fd8afa5 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sat, 8 Jul 2023 09:57:38 +0200 Subject: [PATCH] goimapnotify: remove test dependency on notmuch Also minor test cleanup. --- .../modules/programs/goimapnotify/launchd.nix | 57 +++++++++---------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/tests/modules/programs/goimapnotify/launchd.nix b/tests/modules/programs/goimapnotify/launchd.nix index c7a81a3af..3d4eca244 100644 --- a/tests/modules/programs/goimapnotify/launchd.nix +++ b/tests/modules/programs/goimapnotify/launchd.nix @@ -5,37 +5,36 @@ with lib; { imports = [ ../../accounts/email-test-accounts.nix ]; - config = { - accounts.email.accounts = { - "hm@example.com" = { - notmuch.enable = true; - imap.port = 993; + accounts.email.accounts = { + "hm@example.com" = { + notmuch.enable = true; + imap.port = 993; - imapnotify = { - enable = true; - boxes = [ "Inbox" ]; - onNotify = '' - ${pkgs.notmuch}/bin/notmuch new - ''; - }; + imapnotify = { + enable = true; + boxes = [ "Inbox" ]; + onNotify = '' + ${pkgs.notmuch}/bin/notmuch new + ''; }; }; - - services.imapnotify = { - enable = true; - package = (config.lib.test.mkStubPackage { - name = "goimapnotify"; - outPath = "@goimapnotify@"; - }); - }; - - nmt.script = let - serviceFileName = - "org.nix-community.home.imapnotify-hm-example.com.plist"; - in '' - serviceFile=LaunchAgents/${serviceFileName} - assertFileExists $serviceFile - assertFileContent $serviceFile ${./launchd.plist} - ''; }; + + services.imapnotify = { + enable = true; + package = (config.lib.test.mkStubPackage { + name = "goimapnotify"; + outPath = "@goimapnotify@"; + }); + }; + + test.stubs.notmuch = { }; + + nmt.script = let + serviceFileName = "org.nix-community.home.imapnotify-hm-example.com.plist"; + in '' + serviceFile=LaunchAgents/${serviceFileName} + assertFileExists $serviceFile + assertFileContent $serviceFile ${./launchd.plist} + ''; }