mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
eza: add tests
This commit is contained in:
parent
edaeeda264
commit
7b2aae3fb3
9 changed files with 220 additions and 0 deletions
|
|
@ -35,6 +35,7 @@ let
|
|||
"earthly"
|
||||
"emacs"
|
||||
"espanso"
|
||||
"eza"
|
||||
"fastfetch"
|
||||
"feh"
|
||||
"fzf"
|
||||
|
|
|
|||
|
|
@ -196,6 +196,7 @@ import nmtSrc {
|
|||
./modules/programs/direnv
|
||||
./modules/programs/earthly
|
||||
./modules/programs/emacs
|
||||
./modules/programs/eza
|
||||
./modules/programs/fastfetch
|
||||
./modules/programs/feh
|
||||
./modules/programs/fish
|
||||
|
|
|
|||
38
tests/modules/programs/eza/bash.nix
Normal file
38
tests/modules/programs/eza/bash.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
programs = {
|
||||
bash.enable = true;
|
||||
|
||||
eza = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
extraOptions = [
|
||||
"--group-directories-first"
|
||||
"--header"
|
||||
];
|
||||
icons = "auto";
|
||||
git = true;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.bashrc
|
||||
assertFileContains \
|
||||
home-files/.bashrc \
|
||||
"alias eza='eza --icons auto --git --group-directories-first --header'"
|
||||
assertFileContains \
|
||||
home-files/.bashrc \
|
||||
"alias ls=eza"
|
||||
assertFileContains \
|
||||
home-files/.bashrc \
|
||||
"alias ll='eza -l'"
|
||||
assertFileContains \
|
||||
home-files/.bashrc \
|
||||
"alias la='eza -a'"
|
||||
assertFileContains \
|
||||
home-files/.bashrc \
|
||||
"alias lt='eza --tree'"
|
||||
assertFileContains \
|
||||
home-files/.bashrc \
|
||||
"alias lla='eza -la'"
|
||||
'';
|
||||
}
|
||||
8
tests/modules/programs/eza/default.nix
Normal file
8
tests/modules/programs/eza/default.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
eza-bash = ./bash.nix;
|
||||
eza-fish = ./fish.nix;
|
||||
eza-ion = ./ion.nix;
|
||||
eza-nushell = ./nushell.nix;
|
||||
eza-theme = ./theme.nix;
|
||||
eza-zsh = ./zsh.nix;
|
||||
}
|
||||
38
tests/modules/programs/eza/fish.nix
Normal file
38
tests/modules/programs/eza/fish.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
programs = {
|
||||
fish.enable = true;
|
||||
|
||||
eza = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
extraOptions = [
|
||||
"--group-directories-first"
|
||||
"--header"
|
||||
];
|
||||
icons = "auto";
|
||||
git = true;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/fish/config.fish
|
||||
assertFileContains \
|
||||
home-files/.config/fish/config.fish \
|
||||
"alias eza 'eza --icons auto --git --group-directories-first --header'"
|
||||
assertFileContains \
|
||||
home-files/.config/fish/config.fish \
|
||||
"alias ls eza"
|
||||
assertFileContains \
|
||||
home-files/.config/fish/config.fish \
|
||||
"alias ll 'eza -l'"
|
||||
assertFileContains \
|
||||
home-files/.config/fish/config.fish \
|
||||
"alias la 'eza -a'"
|
||||
assertFileContains \
|
||||
home-files/.config/fish/config.fish \
|
||||
"alias lt 'eza --tree'"
|
||||
assertFileContains \
|
||||
home-files/.config/fish/config.fish \
|
||||
"alias lla 'eza -la'"
|
||||
'';
|
||||
}
|
||||
38
tests/modules/programs/eza/ion.nix
Normal file
38
tests/modules/programs/eza/ion.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
programs = {
|
||||
ion.enable = true;
|
||||
|
||||
eza = {
|
||||
enable = true;
|
||||
enableIonIntegration = true;
|
||||
extraOptions = [
|
||||
"--group-directories-first"
|
||||
"--header"
|
||||
];
|
||||
icons = "auto";
|
||||
git = true;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/ion/initrc
|
||||
assertFileContains \
|
||||
home-files/.config/ion/initrc \
|
||||
"alias eza = 'eza --icons auto --git --group-directories-first --header'"
|
||||
assertFileContains \
|
||||
home-files/.config/ion/initrc \
|
||||
"alias ls = eza"
|
||||
assertFileContains \
|
||||
home-files/.config/ion/initrc \
|
||||
"alias ll = 'eza -l'"
|
||||
assertFileContains \
|
||||
home-files/.config/ion/initrc \
|
||||
"alias la = 'eza -a'"
|
||||
assertFileContains \
|
||||
home-files/.config/ion/initrc \
|
||||
"alias lt = 'eza --tree'"
|
||||
assertFileContains \
|
||||
home-files/.config/ion/initrc \
|
||||
"alias lla = 'eza -la'"
|
||||
'';
|
||||
}
|
||||
38
tests/modules/programs/eza/nushell.nix
Normal file
38
tests/modules/programs/eza/nushell.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
programs = {
|
||||
nushell.enable = true;
|
||||
|
||||
eza = {
|
||||
enable = true;
|
||||
enableNushellIntegration = true;
|
||||
extraOptions = [
|
||||
"--group-directories-first"
|
||||
"--header"
|
||||
];
|
||||
icons = "auto";
|
||||
git = true;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/nushell/config.nu
|
||||
assertFileContains \
|
||||
home-files/.config/nushell/config.nu \
|
||||
'alias "eza" = eza --icons auto --git --group-directories-first --header'
|
||||
assertFileContains \
|
||||
home-files/.config/nushell/config.nu \
|
||||
'alias "ls" = eza'
|
||||
assertFileContains \
|
||||
home-files/.config/nushell/config.nu \
|
||||
'alias "ll" = eza -l'
|
||||
assertFileContains \
|
||||
home-files/.config/nushell/config.nu \
|
||||
'alias "la" = eza -a'
|
||||
assertFileContains \
|
||||
home-files/.config/nushell/config.nu \
|
||||
'alias "lt" = eza --tree'
|
||||
assertFileContains \
|
||||
home-files/.config/nushell/config.nu \
|
||||
'alias "lla" = eza -la'
|
||||
'';
|
||||
}
|
||||
20
tests/modules/programs/eza/theme.nix
Normal file
20
tests/modules/programs/eza/theme.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
programs.eza = {
|
||||
enable = true;
|
||||
theme = {
|
||||
colors = {
|
||||
background = "254";
|
||||
foreground = "237";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/eza/theme.yml
|
||||
assertFileContent home-files/.config/eza/theme.yml ${builtins.toFile "eza-theme-expected.yml" ''
|
||||
colors:
|
||||
background: '254'
|
||||
foreground: '237'
|
||||
''}
|
||||
'';
|
||||
}
|
||||
38
tests/modules/programs/eza/zsh.nix
Normal file
38
tests/modules/programs/eza/zsh.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
programs = {
|
||||
zsh.enable = true;
|
||||
|
||||
eza = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
extraOptions = [
|
||||
"--group-directories-first"
|
||||
"--header"
|
||||
];
|
||||
icons = "auto";
|
||||
git = true;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.zshrc
|
||||
assertFileContains \
|
||||
home-files/.zshrc \
|
||||
"alias -- eza='eza --icons auto --git --group-directories-first --header'"
|
||||
assertFileContains \
|
||||
home-files/.zshrc \
|
||||
"alias -- ls=eza"
|
||||
assertFileContains \
|
||||
home-files/.zshrc \
|
||||
"alias -- ll='eza -l'"
|
||||
assertFileContains \
|
||||
home-files/.zshrc \
|
||||
"alias -- la='eza -a'"
|
||||
assertFileContains \
|
||||
home-files/.zshrc \
|
||||
"alias -- lt='eza --tree'"
|
||||
assertFileContains \
|
||||
home-files/.zshrc \
|
||||
"alias -- lla='eza -la'"
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue