ty: add module
This commit is contained in:
parent
f9d45d664e
commit
6bdf2a68e1
5 changed files with 107 additions and 0 deletions
4
tests/modules/programs/ty/default.nix
Normal file
4
tests/modules/programs/ty/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
ty-example-settings = ./example-settings.nix;
|
||||
ty-no-settings = ./no-settings.nix;
|
||||
}
|
||||
25
tests/modules/programs/ty/example-settings.nix
Normal file
25
tests/modules/programs/ty/example-settings.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.ty = {
|
||||
enable = true;
|
||||
settings = {
|
||||
rules.index-out-of-bounds = "ignore";
|
||||
};
|
||||
};
|
||||
|
||||
test.stubs.ty = { };
|
||||
|
||||
nmt.script =
|
||||
let
|
||||
expectedConfigPath = "home-files/.config/ty/ty.toml";
|
||||
expectedConfigContent = pkgs.writeText "ty.config-custom.expected" ''
|
||||
[rules]
|
||||
index-out-of-bounds = "ignore"
|
||||
'';
|
||||
in
|
||||
''
|
||||
assertFileExists "${expectedConfigPath}"
|
||||
assertFileContent "${expectedConfigPath}" "${expectedConfigContent}"
|
||||
'';
|
||||
}
|
||||
17
tests/modules/programs/ty/no-settings.nix
Normal file
17
tests/modules/programs/ty/no-settings.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.ty = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
test.stubs.ty = { };
|
||||
|
||||
nmt.script =
|
||||
let
|
||||
expectedConfigPath = "home-files/.config/ty/ty.toml";
|
||||
in
|
||||
''
|
||||
assertPathNotExists "${expectedConfigPath}"
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue