Skip to content

Commit 3325dcb

Browse files
committed
plugins/gitgutter: add tests
1 parent b6d9638 commit 3325dcb

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{ lib, pkgs, ... }:
2+
{
3+
empty = {
4+
plugins.gitgutter.enable = true;
5+
};
6+
7+
grep-command =
8+
{ config, ... }:
9+
{
10+
plugins.gitgutter = {
11+
enable = true;
12+
grep = {
13+
package = pkgs.gnugrep;
14+
command = "";
15+
};
16+
};
17+
assertions = [
18+
{
19+
assertion =
20+
config.extraPackages != [ ] && lib.any (x: x.pname or null == "gnugrep") config.extraPackages;
21+
message = "gnugrep wasn't found when it was expected";
22+
}
23+
];
24+
};
25+
26+
no-packages =
27+
{ config, ... }:
28+
{
29+
globals.gitgutter_git_executable = lib.getExe pkgs.git;
30+
plugins.gitgutter = {
31+
enable = true;
32+
gitPackage = null;
33+
};
34+
assertions = [
35+
{
36+
assertion = lib.all (x: x.pname or null != "git") config.extraPackages;
37+
message = "A git package found in extraPackages when it wasn't expected";
38+
}
39+
];
40+
};
41+
}

0 commit comments

Comments
 (0)