Commit 8caea5c4 authored by Roy Marmelstein's avatar Roy Marmelstein

Additional tests, path fixing

parent d3e733d2
...@@ -174,7 +174,7 @@ public class Zip { ...@@ -174,7 +174,7 @@ public class Zip {
var totalSize: Double = 0.0 var totalSize: Double = 0.0
// Check if paths exist and get totalSize for progress handler // Check if paths exist and get totalSize for progress handler
for path in paths { for path in paths {
if fileManager.fileExistsAtPath(path.absoluteString) == false { if fileManager.fileExistsAtPath(path.path!) == false {
throw ZipError.FileNotFound throw ZipError.FileNotFound
} }
do { do {
......
...@@ -67,7 +67,18 @@ class ZipTests: XCTestCase { ...@@ -67,7 +67,18 @@ class ZipTests: XCTestCase {
XCTFail() XCTFail()
} }
} }
func testQuickZip() {
do {
let imageURL1 = NSBundle(forClass: ZipTests.self).URLForResource("3crBXeO", withExtension: "gif")!
let imageURL2 = NSBundle(forClass: ZipTests.self).URLForResource("kYkLkPf", withExtension: "gif")!
let destinationURL = try Zip().quickZipFiles([imageURL1, imageURL2], fileName: "archive")
let fileManager = NSFileManager.defaultManager()
XCTAssertTrue(fileManager.fileExistsAtPath(destinationURL.path!))
}
catch {
XCTFail()
}
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment