New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LSNocilla.sharedInstance().stop() Not working #136
Comments
I don't know what you mean by 'multiple test set' Please provide sample code that reproduces the issue/more detail. I don't know how to look into it based on the info you have provided. |
Just ran into and debugged this issue. The problem happens if you create a new URL session when Nocilla is running, then stop Nocilla and continue using the session. Nocilla swizzles the URL protocols on the default configuration – it cleans them up from the default configuration, but when creating a new session they are likely transferred to the session object, so any session objects created continue intercepting requests. https://github.com/luisobo/Nocilla/blob/master/Nocilla/Hooks/NSURLSession/LSNSURLSessionHook.m |
Yep, just ran into this problem that @stepanhruda described.
e.g. We stub /user/login to return 200 OK. Works fine, but sync data gets called as a result of successful login. We can stub that request too, but it makes no difference since it gets called after .stop(). In other words, at the moment when |
I'm experiencing this too. Right now i just fixed it by using an instance of the network client rather than the shared singleton. But reproduction steps are the same. |
I'm experiencing this too. I "fixed" it with this workaround (calling the stop-function in the setUp()-functions code):
|
I have a multiple test set, one of them uses nocilla so I execute LSNocilla.sharedInstance().start() when it begin and stop it at the end, but when the other test that needs actual internet runs I keep getting "NocillaUnexpectedRequest', reason: 'An unexpected HTTP request was fired.'"
The text was updated successfully, but these errors were encountered: