home-manager/tests/modules/programs/fish/functions.nix
Ryan Orendorff 111011b2c2
fish: add some tests
- If a function is defined, check that the function file exists and
  that the contents matches a given string.

- If no functions exists, the functions folder should not exist.

- Verify plugin functionality.
2020-02-20 00:03:26 +01:00

33 lines
570 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
func = pkgs.writeText "func.fish" ''
function func
echo "Hello"
end
'';
in {
config = {
programs.fish = {
enable = true;
functions = { func = ''echo "Hello"''; };
};
nmt = {
description =
"if fish.function is set, check file exists and contents match";
script = ''
assertFileExists home-files/.config/fish/functions/func.fish
echo ${func}
assertFileContent home-files/.config/fish/functions/func.fish ${func}
'';
};
};
}