This module defines all the functions needed by the test cases
Require a file to be loaded.
iRequiredFileName (String): Name of the Required File being operated by further tests.
# File test/RCodeLevelerTest.rb, line 57 57: def requireFile(iRequiredFileName) 58: requireLevel("RequiredFiles/#{iRequiredFileName}") 59: end
Change the root dir. This is used by each usecase to inform the directory where Required Files are. Clean files from RequiredFiles directories from Ruby’s files cache $”. Clean variables set by required files: $Var, $Var1..4. Add the root dir to $LOAD_PATH. Reset all previously set levels. Reset warning severity to 2.
iRootDir (String): The root dir (containing the FileSystems directory)
# File test/RCodeLevelerTest.rb, line 26 26: def setRootDir(iRootDir) 27: @RootDir = iRootDir 28: $".delete_if do |iFileName| 29: iFileName[0..13] == 'RequiredFiles/' 30: end 31: $Var = nil 32: $Var1 = nil 33: $Var2 = nil 34: $Var3 = nil 35: $Var4 = nil 36: if (!$LOAD_PATH.include?(iRootDir)) 37: $LOAD_PATH << iRootDir 38: end 39: RCodeLeveler.resetLevels 40: RCodeLeveler.setWarningSeverity(2) 41: RCodeLeveler.setOutputDirectory(nil) 42: end
Remove the directory that includes RequiredFiles for the next tests. Otherwise it is possible that files getting same names in different RequiredFiles directories are messed up in the requireFile method.
# File test/RCodeLevelerTest.rb, line 47 47: def teardown 48: $LOAD_PATH.delete_if do |iDirName| 49: iDirName == @RootDir 50: end 51: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.