From e0336ad2447c4826c234325182da683d8a3feaea Mon Sep 17 00:00:00 2001 From: Louis Orleans Date: Sun, 1 Sep 2024 01:40:55 -0700 Subject: [PATCH] process-compose: add shortcuts test --- tests/default.nix | 1 + .../programs/process-compose/default.nix | 1 + .../programs/process-compose/shortcuts.nix | 22 +++++++++++++++++++ .../programs/process-compose/shortcuts.yaml | 3 +++ 4 files changed, 27 insertions(+) create mode 100644 tests/modules/programs/process-compose/default.nix create mode 100644 tests/modules/programs/process-compose/shortcuts.nix create mode 100644 tests/modules/programs/process-compose/shortcuts.yaml diff --git a/tests/default.nix b/tests/default.nix index 1c143716f..edbb46b30 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -127,6 +127,7 @@ in import nmtSrc { ./modules/programs/powerline-go ./modules/programs/pubs ./modules/programs/pyenv + ./modules/programs/process-compose ./modules/programs/qcal ./modules/programs/qutebrowser ./modules/programs/ranger diff --git a/tests/modules/programs/process-compose/default.nix b/tests/modules/programs/process-compose/default.nix new file mode 100644 index 000000000..ae330e799 --- /dev/null +++ b/tests/modules/programs/process-compose/default.nix @@ -0,0 +1 @@ +{ process-compose-shortcuts = ./shortcuts.nix; } diff --git a/tests/modules/programs/process-compose/shortcuts.nix b/tests/modules/programs/process-compose/shortcuts.nix new file mode 100644 index 000000000..a512029f6 --- /dev/null +++ b/tests/modules/programs/process-compose/shortcuts.nix @@ -0,0 +1,22 @@ +{ config, pkgs, ... }: + +{ + config = { + programs.process-compose = { + enable = true; + package = pkgs.writeScriptBin "dummy-process-compose" ""; + shortcuts = { help.shortcut = "?"; }; + }; + + nmt.script = let + configDir = if pkgs.stdenv.isDarwin then + "home-files/Library/Application Support/process-compose" + else + "home-files/.config/process-compose"; + in '' + shortcutsFile="${configDir}/shortcuts.yaml" + assertFileExists "$shortcutsFile" + assertFileContent "$shortcutsFile" "${./shortcuts.yaml}" + ''; + }; +} diff --git a/tests/modules/programs/process-compose/shortcuts.yaml b/tests/modules/programs/process-compose/shortcuts.yaml new file mode 100644 index 000000000..d6a67c403 --- /dev/null +++ b/tests/modules/programs/process-compose/shortcuts.yaml @@ -0,0 +1,3 @@ +shortcuts: + help: + shortcut: '?'