Commit d3e733d2 authored by Roy Marmelstein's avatar Roy Marmelstein

Additional tests

parent c29f08bc
......@@ -29,8 +29,45 @@ class ZipTests: XCTestCase {
catch {
XCTFail()
}
}
func testQuickUnzipNonExistingPath() {
do {
let filePathURL = NSBundle(forClass: ZipTests.self).resourcePath
let fileAbsoluteURL = NSURL(string:"\(filePathURL!)/bb9.zip")
let destinationURL = try Zip().quickUnzipFile(fileAbsoluteURL!)
let fileManager = NSFileManager.defaultManager()
XCTAssertFalse(fileManager.fileExistsAtPath(destinationURL.path!))
}
catch {
XCTAssert(true)
}
}
func testQuickUnzipNonZipPath() {
do {
let fileAbsoluteURL = NSBundle(forClass: ZipTests.self).URLForResource("3crBXeO", withExtension: "gif")!
let destinationURL = try Zip().quickUnzipFile(fileAbsoluteURL)
let fileManager = NSFileManager.defaultManager()
XCTAssertFalse(fileManager.fileExistsAtPath(destinationURL.path!))
}
catch {
XCTAssert(true)
}
}
func testQuickUnzipProgress() {
do {
let fileAbsoluteURL = NSBundle(forClass: ZipTests.self).URLForResource("bb8", withExtension: "zip")!
try Zip().quickUnzipFile(fileAbsoluteURL, progress: { (progress) -> () in
XCTAssert(true)
})
}
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