diff --git a/Zip/Zip.swift b/Zip/Zip.swift index 931aa3a83ee7308de4368d5ffb7231a79a9592eb..977c81d63fc06d54c843951c98fa6a596f759ca4 100644 --- a/Zip/Zip.swift +++ b/Zip/Zip.swift @@ -174,7 +174,7 @@ public class Zip { var totalSize: Double = 0.0 // Check if paths exist and get totalSize for progress handler for path in paths { - if fileManager.fileExistsAtPath(path.absoluteString) == false { + if fileManager.fileExistsAtPath(path.path!) == false { throw ZipError.FileNotFound } do { diff --git a/ZipTests/ZipTests.swift b/ZipTests/ZipTests.swift index bc173db126495f6b1759dddc4a48fbf3d75ccf71..7ef0e08e0a7b6d51aab7df1df1124577be9d084e 100644 --- a/ZipTests/ZipTests.swift +++ b/ZipTests/ZipTests.swift @@ -67,7 +67,18 @@ class ZipTests: XCTestCase { 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() + } + } + }