Add module filtering to install.sh/main

This commit is contained in:
Rezart Qelibari
2022-01-28 18:37:45 +01:00
parent eee681bae9
commit a33958a1fb
4 changed files with 67 additions and 1 deletions

4
spec/autoload.sh Normal file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env zsh
FPATH="`pwd`/zshlib:${FPATH}"
local funcNames=("${(@f)$(find . -type f -perm +u=x -maxdepth 1 | awk -F/ '{ print $NF }')}")
autoload -Uz "${funcNames[@]}"

View File

@@ -0,0 +1,26 @@
Describe 'getFilteredModules'
Include ./install.sh
It 'returns all modules if no module arg is given'
allModules=(module1 module2)
When call getFilteredModules
The output should eq 'module1 module2'
The status should be success
End
It 'returns only mentioned modules'
allModules=(module1 module2 module3)
module=(module3 module2)
When call getFilteredModules
The output should eq 'module2 module3'
The status should be success
End
It 'returns only not mentioned modules if inversed'
allModules=(module1 module2 module3)
module=(module3 module1)
inverse=true
When call getFilteredModules
The output should eq 'module2'
The status should be success
End
End