1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-23 19:49:45 +01:00
home-manager/tests/modules/programs/git/git-with-str-extra-config.nix
Robert Helgesson 9d53afb709
tests: add support for asserting warnings
This adds a "test.asserts" module that currently just provides a
convenient way to assert on the content of warnings. By default all
tests will assert that no warnings are given.
2020-12-30 17:25:48 +01:00

29 lines
688 B
Nix

{ config, lib, pkgs, ... }:
with lib;
{
config = {
programs.git = {
enable = true;
package = pkgs.gitMinimal;
extraConfig = ''
This can be anything.
'';
userEmail = "user@example.org";
userName = "John Doe";
};
test.asserts.warnings.expected = [''
Using programs.git.extraConfig as a string option is
deprecated and will be removed in the future. Please
change to using it as an attribute set instead.
''];
nmt.script = ''
assertFileExists home-files/.config/git/config
assertFileContent home-files/.config/git/config \
${./git-with-str-extra-config-expected.conf}
'';
};
}