tests/starship: add no settings and presets tests
Help catch future regressions Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
3113094428
commit
2a39b0828b
3 changed files with 39 additions and 0 deletions
|
|
@ -1,5 +1,7 @@
|
|||
{
|
||||
starship-settings = ./settings.nix;
|
||||
starship-no-settings = ./no-settings.nix;
|
||||
starship-presets = ./presets.nix;
|
||||
starship-fish-with-transience = ./fish_with_transience.nix;
|
||||
starship-fish-without-transience = ./fish_without_transience.nix;
|
||||
starship-fish-with-interactive = ./fish_with_interactive.nix;
|
||||
|
|
|
|||
7
tests/modules/programs/starship/no-settings.nix
Normal file
7
tests/modules/programs/starship/no-settings.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
programs.starship.enable = true;
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/starship.toml
|
||||
'';
|
||||
}
|
||||
30
tests/modules/programs/starship/presets.nix
Normal file
30
tests/modules/programs/starship/presets.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ pkgs, ... }:
|
||||
let
|
||||
starshipPackage = pkgs.runCommand "starship-test-package" { } ''
|
||||
mkdir -p "$out/share/starship/presets"
|
||||
cat > "$out/share/starship/presets/nerd-font-symbols.toml" <<'EOF'
|
||||
format = "$all"
|
||||
[directory]
|
||||
style = "blue"
|
||||
EOF
|
||||
'';
|
||||
in
|
||||
{
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
package = starshipPackage;
|
||||
presets = [ "nerd-font-symbols" ];
|
||||
settings = {
|
||||
add_newline = false;
|
||||
scan_timeout = 10;
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/starship.toml
|
||||
assertFileContains home-files/.config/starship.toml 'format = "$all"'
|
||||
assertFileContains home-files/.config/starship.toml 'style = "blue"'
|
||||
assertFileContains home-files/.config/starship.toml "add_newline = false"
|
||||
assertFileContains home-files/.config/starship.toml "scan_timeout = 10"
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue