Skip to content

Commit f930582

Browse files
committed
vivid: add tests
1 parent d96fc0f commit f930582

File tree

8 files changed

+1422
-0
lines changed

8 files changed

+1422
-0
lines changed

tests/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ in import nmtSrc {
159159
./modules/programs/translate-shell
160160
./modules/programs/vifm
161161
./modules/programs/vim-vint
162+
./modules/programs/vivid
162163
./modules/programs/vscode
163164
./modules/programs/watson
164165
./modules/programs/wezterm
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
vivid-empty-settings = ./empty.nix;
3+
vivid-enable-shells = ./enable-shells.nix;
4+
vivid-filetypes = ./filetypes-example.nix;
5+
vivid-themes = ./themes-example.nix;
6+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
programs.vivid = {
3+
enable = true;
4+
theme = "test";
5+
};
6+
test.stubs.vivid = { };
7+
nmt.script = ''
8+
assertPathNotExists home-files/.config/vivid/filetypes.yaml
9+
assertPathNotExists home-files/.config/vivid/themes
10+
'';
11+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{ lib, ... }:
2+
3+
{
4+
programs = {
5+
vivid = {
6+
enable = true;
7+
theme = "test";
8+
enableBashIntegration = true;
9+
enableFishIntegration = true;
10+
enableNushellIntegration = true;
11+
enableZshIntegration = true;
12+
};
13+
bash.enable = true;
14+
fish.enable = true;
15+
nushell.enable = true;
16+
zsh.enable = true;
17+
};
18+
19+
# Needed to avoid error with dummy fish package.
20+
xdg.dataFile."fish/home-manager_generated_completions".source =
21+
lib.mkForce (builtins.toFile "empty" "");
22+
23+
test.stubs.vivid = { };
24+
25+
nmt.script = ''
26+
assertFileExists home-files/.bashrc
27+
assertFileContains \
28+
home-files/.bashrc \
29+
'export LS_COLORS="$(@vivid@/bin/dummy generate test)"'
30+
31+
assertFileExists home-files/.config/fish/config.fish
32+
assertFileContains \
33+
home-files/.config/fish/config.fish \
34+
'set -gx LS_COLORS (@vivid@/bin/dummy generate test)'
35+
36+
assertFileExists home-files/.config/nushell/env.nu
37+
assertFileContains \
38+
home-files/.config/nushell/env.nu \
39+
'"LS_COLORS": (@vivid@/bin/dummy generate test)'
40+
41+
assertFileExists home-files/.zshrc
42+
assertFileContains \
43+
home-files/.zshrc \
44+
'export LS_COLORS="$(@vivid@/bin/dummy generate test)"'
45+
'';
46+
}

0 commit comments

Comments
 (0)