Repository: Moya/Moya
File: Tests/MoyaProviderIntegrationTests.swift (Swift)

Code before:
                    expect(message) == zenMessage
                }

                it("returns some data for user profile request") {
                    var message: String?

                    waitUntil { done in
                        let target: GitHub = .userProfile("ashfurrow")
                        provider.reactive.request(target).startWithResult { result in
                            if case .success(let response) = result {
                                message = String(data: response.data, encoding: String.Encoding.utf8)
                                done()
                            }
                        }
                    }

                    expect(message) == userMessage
                }
            }
        }

        // Resolves ValidationType not working with multipart upload #1590
        describe("a provider performing a multipart upload with Alamofire validation") {
            let provider = MoyaProvider<HTTPBin>()
            let formData = HTTPBin.createTestMultipartFormData()
            it("returns an error for status code different than 287") {
                let target = HTTPBin.validatedUploadMultipart(formData, nil, [287])
                var receievedResponse: Response?
                var receivedError: Error?
                waitUntil(timeout: 5.0) { done in
                    provider.request(target) { result in
                        switch result {
                        case .success(let response):
                            receievedResponse = response
                        case .failure(let error):
                            receivedError = error
                        }
                        done()
                    }
                }
                expect(receievedResponse).to(beNil())
                expect(receivedError).toNot(beNil())
            }
            it("returns a valid response for .succesCodes") {
                let successCodes = ValidationType.successCodes.statusCodes
                let target = HTTPBin.validatedUploadMultipart(formData, nil, successCodes)
                var receievedResponse: Response?
                var receivedError: Error?
                waitUntil(timeout: 5.0) { done in
                    provider.request(target) { result in
                        switch result {

Review comment (suggestion):
last one, can we add few empty lines to the code? looks really stacked 😅 

e.g. before `it("")`, in `it("")` we could use a 3 blocks scenario similar to Act-Act-Assert which would add new line before `waitUntil` and one before expects.

Code after:
                    expect(message) == zenMessage
                }

                it("returns some data for user profile request") {
                    var message: String?

                    waitUntil { done in
                        let target: GitHub = .userProfile("ashfurrow")
                        provider.reactive.request(target).startWithResult { result in
                            if case .success(let response) = result {
                                message = String(data: response.data, encoding: String.Encoding.utf8)
                                done()
                            }
                        }
                    }

                    expect(message) == userMessage
                }
            }
        }

        // Resolves ValidationType not working with multipart upload #1590
        describe("a provider performing a multipart upload with Alamofire validation") {
            let provider = MoyaProvider<HTTPBin>()
            let formData = HTTPBin.createTestMultipartFormData()

            it("returns an error for status code different than 287") {
                let target = HTTPBin.validatedUploadMultipart(formData, nil, [287])
                var receievedResponse: Response?
                var receivedError: Error?

                waitUntil(timeout: 5.0) { done in
                    provider.request(target) { result in
                        switch result {
                        case .success(let response):
                            receievedResponse = response
                        case .failure(let error):
                            receivedError = error
                        }
                        done()
                    }
                }

                expect(receievedResponse).to(beNil())
                expect(receivedError).toNot(beNil())
            }

            it("returns a valid response for .succesCodes") {
                let successCodes = ValidationType.successCodes.statusCodes
                let target = HTTPBin.validatedUploadMultipart(formData, nil, successCodes)
                var receievedResponse: Response?