tests: add option test.stubs
This option provides a more convenient way to overlay dummy packages. It also adds a function `config.lib.test.mkStubPackage` that can, e.g., be used for `package` options.
This commit is contained in:
parent
b0651cc217
commit
cb09a968e9
159 changed files with 753 additions and 981 deletions
|
|
@ -21,16 +21,14 @@ with lib;
|
|||
};
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(self: super: {
|
||||
zsh = pkgs.writeScriptBin "dummy-zsh" "";
|
||||
zplug = pkgs.writeScriptBin "dummy-zplug" "";
|
||||
})
|
||||
];
|
||||
test.stubs = {
|
||||
zplug = { };
|
||||
zsh = { };
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileRegex home-files/.zshrc \
|
||||
'^source ${builtins.storeDir}/.*zplug.*/init\.zsh$'
|
||||
assertFileContains home-files/.zshrc \
|
||||
'source @zplug@/init.zsh'
|
||||
|
||||
assertFileContains home-files/.zshrc \
|
||||
'zplug "plugins/git", from:oh-my-zsh'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue