<commit_before>
import Quick
import Nimble

import Faro
@testable import Faro_Example

class ServiceQueueSpec: QuickSpec {

    override func spec() {
        describe("ServiceQueueSpec") {

            context("Test the background queue behaviour") {

                var mockSession: MockSession!
                var service: ServiceQueue!
                let call = Call(path: "mock")

                beforeEach {
                    mockSession = MockSession()
                    service = ServiceQueue(configuration: Configuration(baseURL: "mockService"), session: mockSession)
                    mockSession.urlResponse = HTTPURLResponse(url: URL(string: "http://www.google.com")!, statusCode: 200, httpVersion:nil, headerFields: nil)
                }

                context("not started") {

                    it("add taks to queue") {
                        var succeeded = false
                        service.perform(call, autoStart: false) { (result: Result<MockModel>) in
                            succeeded = true
                        }

                        expect(succeeded) == false
                    }
                }

                context("started") {

                }
            }
        }
    }
    
}<commit_msg>Async testing for the queue<commit_after>
import Quick
import Nimble

import Faro
@testable import Faro_Example

class ServiceQueueSpec: QuickSpec {

    override func spec() {
        describe("ServiceQueueSpec") {

            context("Test the background queue behaviour") {

                var mockSession: MockSession!
                var service: ServiceQueue!
                let call = Call(path: "mock")
                let config = Configuration(baseURL: "mockService")

                beforeEach {
                    mockSession = MockAsyncSession()
                    mockSession.urlResponse = HTTPURLResponse(url: URL(string: "http://www.google.com")!, statusCode: 200, httpVersion:nil, headerFields: nil)
                }

                context("not started") {

                    it("add taks to queue") {
                        var succeeded = false
                        service = ServiceQueue(configuration: config, faroSession: mockSession) {
                            succeeded = true
                        }

                        service.perform(call, autoStart: false) { (result: Result<MockModel>) in
                            succeeded = true
                        }
                        expect(service.hasOustandingTasks) == true
                        expect(succeeded).toNotEventually(beTrue())
                    }
                }

                context("started") {

                    it("still start on autostart") {
                        service = ServiceQueue(configuration: config, faroSession: mockSession) {
                            print("final")
                        }
                        waitUntil { done in
                            service.perform(call, autoStart: true) { (result: Result<MockModel>) in
                                expect(service.hasOustandingTasks) == false
                                done()
                            }
                        }
                    }
                }
            }
        }
    }
    
}
{'fraction_non_alphanumeric': 0.08027870342320509, 'fraction_numerical': 0.0018176310209027568, 'mean_word_length': 1.208695652173913, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7231351', 'n_tokens_mistral': 775, 'n_tokens_neox': 691, 'n_words': 172}