mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-29 05:31:03 +01:00
tests/git: add settigs deprecation test
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
a709427248
commit
aeabc1ac63
2 changed files with 30 additions and 0 deletions
|
|
@ -9,4 +9,5 @@
|
||||||
git-with-hooks = ./git-with-hooks.nix;
|
git-with-hooks = ./git-with-hooks.nix;
|
||||||
git-with-lfs = ./git-with-lfs.nix;
|
git-with-lfs = ./git-with-lfs.nix;
|
||||||
git-with-maintenance = ./git-with-maintenance.nix;
|
git-with-maintenance = ./git-with-maintenance.nix;
|
||||||
|
git-settings-deprecations = ./git-settings-deprecations.nix;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
29
tests/modules/programs/git/git-settings-deprecations.nix
Normal file
29
tests/modules/programs/git/git-settings-deprecations.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
{ lib, options, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
userName = "John Doe";
|
||||||
|
userEmail = "john@example.com";
|
||||||
|
aliases = {
|
||||||
|
co = "checkout";
|
||||||
|
st = "status";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
test.asserts.warnings.expected = [
|
||||||
|
"The option `programs.git.aliases' defined in ${lib.showFiles options.programs.git.aliases.files} has been renamed to `programs.git.settings.alias'."
|
||||||
|
"The option `programs.git.userEmail' defined in ${lib.showFiles options.programs.git.userEmail.files} has been renamed to `programs.git.settings.user.email'."
|
||||||
|
"The option `programs.git.userName' defined in ${lib.showFiles options.programs.git.userName.files} has been renamed to `programs.git.settings.user.name'."
|
||||||
|
];
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-files/.config/git/config
|
||||||
|
assertFileContains home-files/.config/git/config '[alias]'
|
||||||
|
assertFileContains home-files/.config/git/config 'co = "checkout"'
|
||||||
|
assertFileContains home-files/.config/git/config 'st = "status"'
|
||||||
|
assertFileContains home-files/.config/git/config '[user]'
|
||||||
|
assertFileContains home-files/.config/git/config 'email = "john@example.com"'
|
||||||
|
assertFileContains home-files/.config/git/config 'name = "John Doe"'
|
||||||
|
'';
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue