Nocilla
Nocilla copied to clipboard
Early returning in -[LSHTTPStubURLProtocol startLoading] to prevent failures
Since NSURLSession will execute the requests on a background thread, we can end up in the situation when the tearDown of a previous unit test stops Nocilla since it no longer needs it, and startLoading gets called while in the middle of another unrelated test case, thus causing an exception and failing the other test.
So, we're early returning from startLoading to prevent this kind of failures.