Use loadModules and askUserModuleQuestions

This commit is contained in:
Rezart Qelibari
2022-03-08 12:42:48 +01:00
parent 79693877b2
commit 322a2aa757
14 changed files with 77 additions and 628 deletions

View File

@@ -1,6 +1,7 @@
Describe 'askNecessaryQuestions'
Include ./install.sh
lop setoutput -l panic tostdout
askUserModuleQuestions() {}
It 'sets config app name'
appname=''
@@ -9,7 +10,7 @@ Describe 'askNecessaryQuestions'
The variable 'appname' should eq 'de.astzweig.macos.system-setup'
End
It 'sets config file path'
It 'sets config file path in config_only mode'
configpath=''
config() { [ "$1" = setconfigfile ] && configpath="$2" }
config_only='/my/file/path'
@@ -17,15 +18,11 @@ Describe 'askNecessaryQuestions'
The variable 'configpath' should eq '/my/file/path'
End
It 'writes config to given file'
declare -A answers
config_only="`mktemp`"
modulesToInstall=('mymodule')
populateQuestionsWithModuleRequiredInformation() { questions+=('my-question' $'What is my question?\ninfo') }
readConfig() { config read mymodule questions my_question }
Data 'myanswer'
It 'sets config file path in if -c option is given'
configpath=''
config() { [ "$1" = setconfigfile ] && configpath="$2" }
config='/my/file/path'
When call askNecessaryQuestions
The variable answers should eq 'myanswer'
The result of function readConfig should eq 'myanswer'
The variable 'configpath' should eq '/my/file/path'
End
End