mirror of
https://github.com/nix-community/home-manager
synced 2024-12-18 15:59:48 +01:00
9d53afb709
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.
29 lines
688 B
Nix
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}
|
|
'';
|
|
};
|
|
}
|