瀏覽代碼

Added marks and made small formatting fixes...no functional changes.

Christian Noon 9 年之前
父節點
當前提交
def5551580
共有 1 個文件被更改,包括 9 次插入6 次删除
  1. 9 6
      Tests/ResponseTests.swift

+ 9 - 6
Tests/ResponseTests.swift

@@ -271,6 +271,8 @@ class ResponseJSONTestCase: BaseTestCase {
 class RedirectResponseTestCase: BaseTestCase {
 class RedirectResponseTestCase: BaseTestCase {
     var manager: Alamofire.Manager!
     var manager: Alamofire.Manager!
 
 
+    // MARK: Setup and Teardown
+
     override func setUp() {
     override func setUp() {
         super.setUp()
         super.setUp()
         manager = Alamofire.Manager(configuration: NSURLSessionConfiguration.ephemeralSessionConfiguration())
         manager = Alamofire.Manager(configuration: NSURLSessionConfiguration.ephemeralSessionConfiguration())
@@ -403,7 +405,7 @@ class RedirectResponseTestCase: BaseTestCase {
         let callbackExpectation = expectationWithDescription("Redirect callback should be made")
         let callbackExpectation = expectationWithDescription("Redirect callback should be made")
         let delegate: Alamofire.Manager.SessionDelegate = manager.delegate
         let delegate: Alamofire.Manager.SessionDelegate = manager.delegate
 
 
-        delegate.taskWillPerformHTTPRedirectionWithCompletion = {_, _, _, request, completion in
+        delegate.taskWillPerformHTTPRedirectionWithCompletion = { _, _, _, request, completion in
             completion(request)
             completion(request)
             callbackExpectation.fulfill()
             callbackExpectation.fulfill()
         }
         }
@@ -422,7 +424,7 @@ class RedirectResponseTestCase: BaseTestCase {
                 error = responseError
                 error = responseError
 
 
                 expectation.fulfill()
                 expectation.fulfill()
-        }
+            }
 
 
         waitForExpectationsWithTimeout(timeout, handler: nil)
         waitForExpectationsWithTimeout(timeout, handler: nil)
 
 
@@ -445,7 +447,7 @@ class RedirectResponseTestCase: BaseTestCase {
         let callbackExpectation = expectationWithDescription("Redirect callback should be made")
         let callbackExpectation = expectationWithDescription("Redirect callback should be made")
         let delegate: Alamofire.Manager.SessionDelegate = manager.delegate
         let delegate: Alamofire.Manager.SessionDelegate = manager.delegate
 
 
-        delegate.taskWillPerformHTTPRedirectionWithCompletion = {_, _, _, _, completion in
+        delegate.taskWillPerformHTTPRedirectionWithCompletion = { _, _, _, _, completion in
             callbackExpectation.fulfill()
             callbackExpectation.fulfill()
             completion(nil)
             completion(nil)
         }
         }
@@ -506,7 +508,7 @@ class RedirectResponseTestCase: BaseTestCase {
                 error = responseError
                 error = responseError
 
 
                 expectation.fulfill()
                 expectation.fulfill()
-        }
+            }
 
 
         waitForExpectationsWithTimeout(timeout, handler: nil)
         waitForExpectationsWithTimeout(timeout, handler: nil)
 
 
@@ -581,11 +583,12 @@ class RedirectResponseTestCase: BaseTestCase {
         let delegate: Alamofire.Manager.SessionDelegate = manager.delegate
         let delegate: Alamofire.Manager.SessionDelegate = manager.delegate
 
 
         var redirectExpectations = [XCTestExpectation]()
         var redirectExpectations = [XCTestExpectation]()
+
         for index in 0..<redirectCount {
         for index in 0..<redirectCount {
             redirectExpectations.insert(expectationWithDescription("Redirect #\(index) callback was received"), atIndex: 0)
             redirectExpectations.insert(expectationWithDescription("Redirect #\(index) callback was received"), atIndex: 0)
         }
         }
 
 
-        delegate.taskWillPerformHTTPRedirectionWithCompletion = {_, _, _, request, completion in
+        delegate.taskWillPerformHTTPRedirectionWithCompletion = { _, _, _, request, completion in
             if let redirectExpectation = redirectExpectations.popLast() {
             if let redirectExpectation = redirectExpectations.popLast() {
                 redirectExpectation.fulfill()
                 redirectExpectation.fulfill()
             } else {
             } else {
@@ -609,7 +612,7 @@ class RedirectResponseTestCase: BaseTestCase {
                 error = responseError
                 error = responseError
 
 
                 expectation.fulfill()
                 expectation.fulfill()
-        }
+            }
 
 
         waitForExpectationsWithTimeout(timeout, handler: nil)
         waitForExpectationsWithTimeout(timeout, handler: nil)