mirror of
https://github.com/nix-community/home-manager
synced 2024-11-05 02:39:45 +01:00
tests/nnn: fix tests (#2746)
There seems to be some changes on how wrapped binaries are implemented on nixpkgs. This broke the nnn tests since the tests were coupled with the old implementation. This commit fix the tests, and also make it less coupled by just testing if the bookmarks/plugins/environment variables are available.
This commit is contained in:
parent
0232fe1b75
commit
b3af91d293
1 changed files with 8 additions and 10 deletions
|
@ -24,6 +24,8 @@
|
||||||
|
|
||||||
test.stubs = {
|
test.stubs = {
|
||||||
nnnDummy.buildScript = ''
|
nnnDummy.buildScript = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
mkdir -p "$out/bin"
|
mkdir -p "$out/bin"
|
||||||
touch "$out/bin/nnn"
|
touch "$out/bin/nnn"
|
||||||
chmod +x "$out/bin/nnn"
|
chmod +x "$out/bin/nnn"
|
||||||
|
@ -40,17 +42,13 @@
|
||||||
script = ''
|
script = ''
|
||||||
assertDirectoryExists home-files/.config/nnn/plugins
|
assertDirectoryExists home-files/.config/nnn/plugins
|
||||||
|
|
||||||
assertFileRegex \
|
for bookmark in 'export NNN_BMS' '~/Downloads' '~/Documents' '~/Pictures' '~/Videos'; do
|
||||||
home-path/bin/nnn \
|
assertFileRegex home-path/bin/nnn "$bookmark"
|
||||||
"^export NNN_BMS='D:~/Downloads;d:~/Documents;p:~/Pictures;v:~/Videos'\''${NNN_BMS:+':'}\$NNN_BMS$"
|
done
|
||||||
|
|
||||||
assertFileRegex \
|
for plugin in 'export NNN_PLUG' 'fzcd' 'finder' 'imgview'; do
|
||||||
home-path/bin/nnn \
|
assertFileRegex home-path/bin/nnn "$plugin"
|
||||||
"^export NNN_PLUG='c:fzcd;f:finder;v:imgview'\''${NNN_PLUG:+':'}\$NNN_PLUG$"
|
done
|
||||||
|
|
||||||
assertFileRegex \
|
|
||||||
home-path/bin/nnn \
|
|
||||||
"/nix/store/.*-"{foo,bar}"/bin"
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue