mirror of
https://github.com/nix-community/home-manager
synced 2024-08-21 11:36:29 +02:00
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.
30 lines
688 B
Nix
30 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}
|
|
'';
|
|
};
|
|
}
|