onevcat před 8 roky
rodič
revize
2fedd535fb

+ 1 - 6
Tests/KingfisherTests/ImageDownloaderTests.swift

@@ -263,7 +263,6 @@ class ImageDownloaderTests: XCTestCase {
                 XCTAssertEqual(error!.code, NSURLErrorCancelled)
                 XCTAssertEqual(error!.code, NSURLErrorCancelled)
                 XCTAssert(progressBlockIsCalled == false, "ProgressBlock should not be called since it is canceled.")
                 XCTAssert(progressBlockIsCalled == false, "ProgressBlock should not be called since it is canceled.")
                 
                 
-//                delay(0.1, block: expectation.fulfill)
                 expectation.fulfill()
                 expectation.fulfill()
         }
         }
         
         
@@ -310,11 +309,7 @@ class ImageDownloaderTests: XCTestCase {
             group.leave()
             group.leave()
         }
         }
         
         
-        group.notify(queue: .main) { 
-//            delay(0.1, block: expectation.fulfill)
-            expectation.fulfill()
-        }
-        
+        group.notify(queue: .main, execute: expectation.fulfill)
         waitForExpectations(timeout: 5, handler: nil)
         waitForExpectations(timeout: 5, handler: nil)
     }
     }
     
     

+ 5 - 27
Tests/KingfisherTests/ImageViewExtensionTests.swift

@@ -148,7 +148,6 @@ class ImageViewExtensionTests: XCTestCase {
         }) { (image, error, cacheType, imageURL) -> () in
         }) { (image, error, cacheType, imageURL) -> () in
             XCTAssertEqual(error?.code, KingfisherError.downloadCancelledBeforeStarting.rawValue, "The error should be downloadCancelledBeforeStarting")
             XCTAssertEqual(error?.code, KingfisherError.downloadCancelledBeforeStarting.rawValue, "The error should be downloadCancelledBeforeStarting")
             XCTAssert(progressBlockIsCalled == false, "ProgressBlock should not be called since it is canceled.")
             XCTAssert(progressBlockIsCalled == false, "ProgressBlock should not be called since it is canceled.")
-//            delay(0.1, block: expectation.fulfill)
             expectation.fulfill()
             expectation.fulfill()
         }
         }
 
 
@@ -173,7 +172,6 @@ class ImageViewExtensionTests: XCTestCase {
                 XCTAssertNotNil(error)
                 XCTAssertNotNil(error)
                 XCTAssertEqual(error?.code, NSURLErrorCancelled)
                 XCTAssertEqual(error?.code, NSURLErrorCancelled)
                 XCTAssert(progressBlockIsCalled == false, "ProgressBlock should not be called since it is canceled.")
                 XCTAssert(progressBlockIsCalled == false, "ProgressBlock should not be called since it is canceled.")
-//                delay(0.1, block: expectation.fulfill)
                 expectation.fulfill()
                 expectation.fulfill()
         }
         }
         
         
@@ -222,11 +220,7 @@ class ImageViewExtensionTests: XCTestCase {
         task1.cancel()
         task1.cancel()
         delay(0.1) { _ = stub!.go() }
         delay(0.1) { _ = stub!.go() }
         
         
-        group.notify(queue: .main) { 
-//            delay(0.1, block: expectation.fulfill)
-            expectation.fulfill()
-        }
-        
+        group.notify(queue: .main, execute: expectation.fulfill)
         waitForExpectations(timeout: 5, handler: nil)
         waitForExpectations(timeout: 5, handler: nil)
     }
     }
     
     
@@ -268,11 +262,7 @@ class ImageViewExtensionTests: XCTestCase {
             _ = stub!.go()
             _ = stub!.go()
         }
         }
         
         
-        group.notify(queue: .main) { 
-//            delay(0.1, block: expectation.fulfill)
-            expectation.fulfill()
-        }
-        
+        group.notify(queue: .main, execute: expectation.fulfill)
         waitForExpectations(timeout: 5, handler: nil)
         waitForExpectations(timeout: 5, handler: nil)
     }
     }
     
     
@@ -320,11 +310,7 @@ class ImageViewExtensionTests: XCTestCase {
             _ = stub!.go()
             _ = stub!.go()
         }
         }
         
         
-        group.notify(queue: .main) { 
-//            delay(0.1, block: expectation.fulfill)
-            expectation.fulfill()
-        }
-        
+        group.notify(queue: .main, execute: expectation.fulfill)
         waitForExpectations(timeout: 5, handler: nil)
         waitForExpectations(timeout: 5, handler: nil)
     }
     }
     
     
@@ -485,11 +471,7 @@ class ImageViewExtensionTests: XCTestCase {
                 group.leave()
                 group.leave()
         }
         }
         
         
-        group.notify(queue: .main) { 
-//            delay(0.1, block: expectation.fulfill)
-            expectation.fulfill()
-        }
-        
+        group.notify(queue: .main, execute: expectation.fulfill)
         waitForExpectations(timeout: 5, handler: nil)
         waitForExpectations(timeout: 5, handler: nil)
     }
     }
     
     
@@ -604,11 +586,7 @@ class ImageViewExtensionTests: XCTestCase {
             group.leave()
             group.leave()
         }
         }
         
         
-        group.notify(queue: .main) { 
-//            delay(0.1, block: expectation.fulfill)
-            expectation.fulfill()
-        }
-        
+        group.notify(queue: .main, execute: expectation.fulfill)
         waitForExpectations(timeout: 1, handler: nil)
         waitForExpectations(timeout: 1, handler: nil)
     }
     }
 }
 }

+ 0 - 2
Tests/KingfisherTests/NSButtonExtensionTests.swift

@@ -123,7 +123,6 @@ class NSButtonExtensionTests: XCTestCase {
             XCTAssertNotNil(error)
             XCTAssertNotNil(error)
             XCTAssertEqual(error?.code, NSURLErrorCancelled)
             XCTAssertEqual(error?.code, NSURLErrorCancelled)
 
 
-//            delay(0.1, block: expectation.fulfill)
             expectation.fulfill()
             expectation.fulfill()
         }
         }
         
         
@@ -148,7 +147,6 @@ class NSButtonExtensionTests: XCTestCase {
             XCTAssertNotNil(error)
             XCTAssertNotNil(error)
             XCTAssertEqual(error?.code, NSURLErrorCancelled)
             XCTAssertEqual(error?.code, NSURLErrorCancelled)
 
 
-//            delay(0.1, block: expectation.fulfill)
             expectation.fulfill()
             expectation.fulfill()
         }
         }
 
 

+ 0 - 2
Tests/KingfisherTests/UIButtonExtensionTests.swift

@@ -123,7 +123,6 @@ class UIButtonExtensionTests: XCTestCase {
                 XCTAssertNotNil(error)
                 XCTAssertNotNil(error)
                 XCTAssertEqual(error?.code, NSURLErrorCancelled)
                 XCTAssertEqual(error?.code, NSURLErrorCancelled)
 
 
-//                delay(0.1, block: expectation.fulfill)
                 expectation.fulfill()
                 expectation.fulfill()
         }
         }
         delay(0.1) { 
         delay(0.1) { 
@@ -147,7 +146,6 @@ class UIButtonExtensionTests: XCTestCase {
                 XCTAssertNotNil(error)
                 XCTAssertNotNil(error)
                 XCTAssertEqual(error?.code, NSURLErrorCancelled)
                 XCTAssertEqual(error?.code, NSURLErrorCancelled)
                 
                 
-//                delay(0.1, block: expectation.fulfill)
                 expectation.fulfill()
                 expectation.fulfill()
         }
         }
         delay(0.1) { 
         delay(0.1) {