6969--- @param ... any
7070local function runTests (func , ...)
7171 --- @class SCM
72+
7273 local scm = require (" ../scm" )
7374 saveConfig (scm )
7475 saveScripts (scm )
8788
8889
8990describe (" Testing everything about SCM:" , function ()
90-
91+ -- only neccessary for local testing
9192 describe (" Copy Files" , function ()
93+
9294 assert .is_true (fs .copy (" ./scm.lua" , " tmpFiles/scm.lua" ), " Could not copy scm.lua" )
9395 assert .is_true (fs .copy (" ./libs/scm/config.lua" , " tmpFiles/config.lua" ), " Could not copy config.lua" )
9496 assert .is_true (fs .copy (" ./libs/scm/net.lua" , " tmpFiles/net.lua" ), " Could not copy net.lua" )
9597 assert .is_true (fs .copy (" ./libs/scm/log.lua" , " tmpFiles/log.lua" ), " Could not copy log.lua" )
9698 assert .is_true (fs .copy (" ./libs/scm/scriptManager.lua" , " tmpFiles/scriptManager.lua" ), " Could not copy scriptManager.lua" )
9799 assert .is_true (fs .copy (" ./libs/scm/autocomplete.lua" , " tmpFiles/autocomplete.lua" ), " Could not copy autocomplete.lua" )
98100 assert .is_true (fs .copy (" ./libs/scm/ui.lua" , " tmpFiles/ui.lua" ), " Could not copy ui.lua" )
99- assert .is_true (fs .copy (" ./scmInstaller.lua" , " tmpFiles/scmInstaller.lua" ), " Could not copy scmInstaller.lua" )
100101 end )
101102
102103 describe (" Require all SCM Modules" , function ()
@@ -109,7 +110,6 @@ describe("Testing everything about SCM:", function()
109110 assert .is .truthy (scm .UI )
110111 assert .is .truthy (scm .ScriptManager )
111112 assert .is .truthy (scm .Log )
112- -- print("Require of all modules test passed")
113113 end )
114114 end )
115115
@@ -129,7 +129,6 @@ describe("Testing everything about SCM:", function()
129129 assert .equal (" Wrong" , config :getAll ()[" verbose" ])
130130 config :set (" verbose" , true )
131131 assert .is .truthy (config :getAll ()[" verbose" ] == true )
132- -- print("Config test passed")
133132 end )
134133 end )
135134 end )
@@ -144,8 +143,6 @@ describe("Testing everything about SCM:", function()
144143 local scripts = scriptManager .scripts
145144 assert .is .truthy (scripts )
146145 assert .is .truthy (type (scripts ) == " table" )
147-
148- -- print("1. ScriptManager test passed (Load Empty)")
149146 end
150147 )
151148 end )
@@ -163,7 +160,6 @@ describe("Testing everything about SCM:", function()
163160 assert .is .truthy (tFile )
164161 assert .is .truthy (tFile .test )
165162 os.remove (" localtestFile.lua" )
166- -- print("2. ScriptManager test passed (Load Local)")
167163 end
168164 )
169165 end )
@@ -176,13 +172,24 @@ describe("Testing everything about SCM:", function()
176172 local scriptManager = scm .ScriptManager
177173 assert .is .truthy (testScript )
178174 assert .is .truthy (testScript .test )
179- -- print("3. ScriptManager test passed (Load Remote)")
180175 end
181176 )
182177 end )
183178 end )
179+ describe (" Update SCM" , function ()
180+ it (" Update SCM" , function ()
181+ runTests (
182+ --- @param scm SCM
183+ function (scm )
184+ -- TODO: implement
185+ end
186+ )
187+ end )
188+ end )
189+
184190 end )
185191
192+ -- only neccessary for local testing
186193 describe (" Restore Files" , function ()
187194 assert .is_true (fs .copy (" tmpFiles/scm.lua" , " ./scm.lua" ), " Could not restore scm.lua" )
188195 assert .is_true (fs .copy (" tmpFiles/config.lua" , " ./libs/scm/config.lua" ), " Could not restore config.lua" )
@@ -191,7 +198,6 @@ describe("Testing everything about SCM:", function()
191198 assert .is_true (fs .copy (" tmpFiles/scriptManager.lua" , " ./libs/scm/scriptManager.lua" ), " Could not restore scriptManager.lua" )
192199 assert .is_true (fs .copy (" tmpFiles/autocomplete.lua" , " ./libs/scm/autocomplete.lua" ), " Could not restore autocomplete.lua" )
193200 assert .is_true (fs .copy (" tmpFiles/ui.lua" , " ./libs/scm/ui.lua" ), " Could not restore ui.lua" )
194- assert .is_true (fs .copy (" tmpFiles/scmInstaller.lua" , " ./scmInstaller.lua" ), " Could not restore scmInstaller.lua" )
195201 os.execute (" rm --recursive ./tmpFiles" )
196202 end )
197203end )
0 commit comments