granted: add module
Signed-off-by: Willi Carlsen <carlsenwilli@gmail.com>
This commit is contained in:
parent
a421804890
commit
48b0a30202
8 changed files with 108 additions and 0 deletions
4
tests/modules/programs/granted/default.nix
Normal file
4
tests/modules/programs/granted/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
granted-integration-enabled = ./integration-enabled.nix;
|
||||
granted-integration-disabled = ./integration-disabled.nix;
|
||||
}
|
||||
27
tests/modules/programs/granted/integration-disabled.nix
Normal file
27
tests/modules/programs/granted/integration-disabled.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs = {
|
||||
granted.enable = true;
|
||||
granted.enableZshIntegration = false;
|
||||
zsh.enable = true;
|
||||
};
|
||||
|
||||
test.stubs.granted = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.zshrc
|
||||
assertFileNotRegex \
|
||||
home-files/.zshrc \
|
||||
'function assume()'
|
||||
assertFileNotRegex \
|
||||
home-files/.zshrc \
|
||||
'export GRANTED_ALIAS_CONFIGURED="true"'
|
||||
assertFileNotRegex \
|
||||
home-files/.zshrc \
|
||||
'source @granted@/bin/.assume-wrapped "$@"'
|
||||
assertFileNotRegex \
|
||||
home-files/.zshrc \
|
||||
'unset GRANTED_ALIAS_CONFIGURED'
|
||||
'';
|
||||
}
|
||||
26
tests/modules/programs/granted/integration-enabled.nix
Normal file
26
tests/modules/programs/granted/integration-enabled.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs = {
|
||||
granted.enable = true;
|
||||
zsh.enable = true;
|
||||
};
|
||||
|
||||
test.stubs.granted = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.zshrc
|
||||
assertFileContains \
|
||||
home-files/.zshrc \
|
||||
'function assume()'
|
||||
assertFileContains \
|
||||
home-files/.zshrc \
|
||||
'export GRANTED_ALIAS_CONFIGURED="true"'
|
||||
assertFileContains \
|
||||
home-files/.zshrc \
|
||||
'source @granted@/bin/.assume-wrapped "$@"'
|
||||
assertFileContains \
|
||||
home-files/.zshrc \
|
||||
'unset GRANTED_ALIAS_CONFIGURED'
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue