         
         // Test show
         APESuperHUD.showOrUpdateHUD(loadingIndicator: .Standard, funnyMessagesLanguage: .English, presentingView: testView)
-        validateShow(testView)
-        let asyncExpectation = expectationWithDescription(description)
-        runWithDelay(APESuperHUD.appearance.animateOutTime + APESuperHUD.appearance.animateInTime, closure: { _ in
-            let hudView = self.getHudView(testView)
+        validateShow(view: testView)
+        let asyncExpectation = expectation(description: description)
+        
+        let delayTime = APESuperHUD.appearance.animateOutTime + APESuperHUD.appearance.animateInTime
+        
+        DispatchQueue.main.asyncAfter(deadline: .now() + delayTime, execute: {
+            
+            let hudView = self.getHudView(view: testView)
             XCTAssertEqual(hudView?.isActiveTimer, true)
             XCTAssertNotEqual(hudView?.informationLabel.text, "")
-            XCTAssertEqual(hudView?.loadingActivityIndicator.hidden, false)
-            XCTAssertEqual(hudView?.loadingActivityIndicator.isAnimating(), true)
+            XCTAssertEqual(hudView?.loadingActivityIndicator.isHidden, false)
+            XCTAssertEqual(hudView?.loadingActivityIndicator.isAnimating, true)
             XCTAssertEqual(hudView?.iconImageView.alpha, 0.0)
             XCTAssertEqual(hudView?.iconImageView.image, nil)
             asyncExpectation.fulfill()
-        })
-        self.waitForExpectationsWithTimeout(8) { error in
-            XCTAssertNil(error, "A error while updating HUD")
-        }
-        
+            
+        })
+        
+        self.waitForExpectations(timeout: 8) { error in
+            XCTAssertNil(error, "A error while updating HUD")
+        }
         
         // Test remove
-        validateRemove(testView, description: "Completion remove loading indicator random funny messages")
+        validateRemove(view: testView, description: "Completion remove loading indicator random funny messages")
     }
     
     // MARK: - Message tests

        
        // Test show
        APESuperHUD.showOrUpdateHUD(loadingIndicator: .Standard, message: originalText, presentingView: testView)
        validateShow(testView)
        validateLoadIndicator(testView, informationText: self.originalText)
        
        // Test update
        APESuperHUD.showOrUpdateHUD(loadingIndicator: .Standard, message: updatedTest, presentingView: testView)
        validateUpdateLoadingIndicator(testView, description: "Delay update loading indicator with info")
        
        // Test remove
        self.validateRemove(testView, description: "Completion remove loading indicator with info")
    }
    
    func validateUpdateLoadingIndicator(view: UIView, description: String) {
        let asyncExpectation = expectationWithDescription(description)
        runWithDelay(3, closure: { _ in
            self.validateShow(view)
            self.validateLoadIndicator(view, informationText: self.updatedTest)
            asyncExpectation.fulfill()
        })
        self.waitForExpectationsWithTimeout(8) { error in
            XCTAssertNil(error, "A error while updating HUD")
        }
    }

        let testView = getTestView()
        
        APESuperHUD.showOrUpdateHUD(icon: createTestImage(width: 200, height: 200), message: originalText, duration: 3.0, presentingView: testView, completion: nil)
        validateShow(view: testView)
        validateMessage(view: testView, informationText: originalText)
        
        let asyncExpectation = expectation(description: "Delay duration message with image icon and duration")
        
        DispatchQueue.main.asyncAfter(deadline: .now() + 4, execute: {
            
            if self.hudViewExists(view: testView) {
                XCTFail("HUD did not get removed.")
            }
            asyncExpectation.fulfill()
            
        })
        
        self.waitForExpectations(timeout: 8) { error in
            XCTAssertNil(error, "A error while updating HUD")
        }
    }
