tests/lazyworktree: add integration asserts

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman
2026-02-28 12:13:07 -06:00
parent f31dbc1042
commit 6656349da8
3 changed files with 34 additions and 1 deletions

View File

@@ -1 +1,4 @@
{ lazyworktree-settings = ./settings.nix; }
{
lazyworktree-no-package-empty-settings = ./no-package-empty-settings.nix;
lazyworktree-settings = ./settings.nix;
}

View File

@@ -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
'';
}

View File

@@ -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)'
'';
}