diff --git a/tests/modules/programs/lazyworktree/default.nix b/tests/modules/programs/lazyworktree/default.nix index cc19e1b10..1d2e28817 100644 --- a/tests/modules/programs/lazyworktree/default.nix +++ b/tests/modules/programs/lazyworktree/default.nix @@ -1 +1,4 @@ -{ lazyworktree-settings = ./settings.nix; } +{ + lazyworktree-no-package-empty-settings = ./no-package-empty-settings.nix; + lazyworktree-settings = ./settings.nix; +} diff --git a/tests/modules/programs/lazyworktree/no-package-empty-settings.nix b/tests/modules/programs/lazyworktree/no-package-empty-settings.nix new file mode 100644 index 000000000..2c986ab47 --- /dev/null +++ b/tests/modules/programs/lazyworktree/no-package-empty-settings.nix @@ -0,0 +1,12 @@ +{ + programs.lazyworktree = { + enable = true; + package = null; + settings = { }; + }; + + nmt.script = '' + assertPathNotExists home-path/bin/lazyworktree + assertPathNotExists home-files/.config/lazyworktree/config.yaml + ''; +} diff --git a/tests/modules/programs/lazyworktree/settings.nix b/tests/modules/programs/lazyworktree/settings.nix index f8ca25c05..e07783a10 100644 --- a/tests/modules/programs/lazyworktree/settings.nix +++ b/tests/modules/programs/lazyworktree/settings.nix @@ -1,6 +1,13 @@ { + programs.bash.enable = true; + programs.fish.enable = true; + programs.zsh.enable = true; + programs.lazyworktree = { enable = true; + enableBashIntegration = true; + enableFishIntegration = true; + enableZshIntegration = true; settings = { worktree_dir = "~/.local/share/worktrees"; sort_mode = "switched"; @@ -21,5 +28,16 @@ assertFileExists home-files/.config/lazyworktree/config.yaml assertFileContent home-files/.config/lazyworktree/config.yaml \ ${./config.yaml} + + assertFileExists home-files/.bashrc + assertFileContains home-files/.bashrc 'function lwt() {' + assertFileContains home-files/.bashrc 'lazyworktree_dir="$(command lazyworktree "$@")" || return' + + assertFileExists home-files/.zshrc + assertFileContains home-files/.zshrc 'function lwt() {' + assertFileContains home-files/.zshrc 'lazyworktree_dir="$(command lazyworktree "$@")" || return' + + assertFileExists home-files/.config/fish/functions/lwt.fish + assertFileContains home-files/.config/fish/functions/lwt.fish 'set -l lazyworktree_dir (command lazyworktree $argv)' ''; }