Fixed tester and removed useless dir creation.

This commit is contained in:
Dominik Picheta 2014-06-20 20:57:18 +01:00
commit dd45dd9418
2 changed files with 3 additions and 6 deletions

View file

@ -409,14 +409,12 @@ proc getBabelTempDir(): string =
proc downloadPkg(url: string, verRange: PVersionRange, proc downloadPkg(url: string, verRange: PVersionRange,
downMethod: TDownloadMethod): string = downMethod: TDownloadMethod): string =
let downloadDir = (getBabelTempDir() / getDownloadDirName(url, verRange)) let downloadDir = (getBabelTempDir() / getDownloadDirName(url, verRange))
createDir(downloadDir.extractFilename)
echo("Downloading ", url, " into ", downloadDir, " using ", downMethod, "...") echo("Downloading ", url, " into ", downloadDir, " using ", downMethod, "...")
doDownload(url, downloadDir, verRange, downMethod) doDownload(url, downloadDir, verRange, downMethod)
result = downloadDir result = downloadDir
proc downloadPkg(pkg: TPackage, verRange: PVersionRange): string = proc downloadPkg(pkg: TPackage, verRange: PVersionRange): string =
let downloadDir = (getBabelTempDir() / getDownloadDirName(pkg, verRange)) let downloadDir = (getBabelTempDir() / getDownloadDirName(pkg, verRange))
createDir(downloadDir.extractFilename)
let downMethod = pkg.downloadMethod.getDownloadMethod() let downMethod = pkg.downloadMethod.getDownloadMethod()
echo("Downloading ", pkg.name, " into ", downloadDir, " using ", downMethod, "...") echo("Downloading ", pkg.name, " into ", downloadDir, " using ", downMethod, "...")
doDownload(pkg.url, downloadDir, verRange, downMethod) doDownload(pkg.url, downloadDir, verRange, downMethod)

View file

@ -12,11 +12,10 @@ test "can reject same version dependencies":
let (outp, exitCode) = execCmdEx(path & " install -y https://github.com/babel-test/packagebin.git") let (outp, exitCode) = execCmdEx(path & " install -y https://github.com/babel-test/packagebin.git")
#echo outp #echo outp
# TODO: outp is not in the correct order. # TODO: outp is not in the correct order.
let ls = outp.splitLines() let ls = outp.strip.splitLines()
check exitCode != QuitSuccess check exitCode != QuitSuccess
check ls[ls.len-2] == "Error: unhandled exception: Cannot satisfy the dependency on PackageA 0.2.0 and PackageA 0.5.0 [EBabel]" check ls[ls.len-1] == "Error: unhandled exception: Cannot satisfy the dependency on PackageA 0.2.0 and PackageA 0.5.0 [EBabel]"
# Last is ""? TODO
test "can update": test "can update":
let (outp, exitCode) = execCmdEx(path & " update") let (outp, exitCode) = execCmdEx(path & " update")
check exitCode == QuitSuccess check exitCode == QuitSuccess