diff --git a/tests/default.nix b/tests/default.nix index 2eaaaa436..8fac3280a 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -173,6 +173,7 @@ in import nmtSrc { ./modules/xresources ] ++ lib.optionals isDarwin [ ./modules/launchd + ./modules/services/emacs-darwin ./modules/services/espanso-darwin ./modules/services/git-sync-darwin ./modules/services/imapnotify-darwin diff --git a/tests/modules/services/emacs-darwin/basic.nix b/tests/modules/services/emacs-darwin/basic.nix new file mode 100644 index 000000000..f65bc2b2f --- /dev/null +++ b/tests/modules/services/emacs-darwin/basic.nix @@ -0,0 +1,13 @@ +{ ... }: { + emacs = { enable = true; }; + + test.stubs.nix = { }; + + nmt.script = '' + serviceFile=LaunchAgents/org.nix-community.home.emacs.plist + + assertFileExists "$serviceFile" + + assertFileContent "$serviceFile" ${./expected-agent.plist} + ''; +} diff --git a/tests/modules/services/emacs-darwin/default.nix b/tests/modules/services/emacs-darwin/default.nix new file mode 100644 index 000000000..8dada1ca9 --- /dev/null +++ b/tests/modules/services/emacs-darwin/default.nix @@ -0,0 +1 @@ +{ emacs = ./basic.nix; } diff --git a/tests/modules/services/emacs-darwin/expected-agent.plist b/tests/modules/services/emacs-darwin/expected-agent.plist new file mode 100644 index 000000000..82cdcc18e --- /dev/null +++ b/tests/modules/services/emacs-darwin/expected-agent.plist @@ -0,0 +1,22 @@ + + + + + KeepAlive + + Crashed + + SuccessfulExit + + + Label + org.nix-community.home.emacs + ProgramArguments + + @emacs/bin/emacs + --fg-daemon + + RunAtLoad + + +%