You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BlockingObservable.single() should not return an Optional:
I recently started to use BlockingObservable.single() in my unit tests and was wondering why it returns an Optional. If you look into the actual implementation it looks to me that it is not possible for the implementation to return an Optional. Because in that case the implementation would throw a RxError.
I had a quick chat on the RxSwift Slack channel and and a brief look my concern was confirmed.
Expected outcome:
I expect either to have a valid non optional result or an error was thrown.
What actually happens:
Currently my result has to be an optional and I either have to add a force unwrap or a guard statement in my test cases.
Self contained code example that reproduces the issue:
BlockingObservable.single() should not return an Optional:
I recently started to use
BlockingObservable.single()
in my unit tests and was wondering why it returns an Optional. If you look into the actual implementation it looks to me that it is not possible for the implementation to return an Optional. Because in that case the implementation would throw a RxError.I had a quick chat on the RxSwift Slack channel and and a brief look my concern was confirmed.
Expected outcome:
I expect either to have a valid non optional result or an error was thrown.
What actually happens:
Currently my result has to be an optional and I either have to add a force unwrap or a guard statement in my test cases.
Self contained code example that reproduces the issue:
RxSwift/RxCocoa/RxBlocking/RxTest version/commit
RxSwift 4.0.0
Platform/Environment
Only use iOS but it should be the same for all platforms.
How easy is to reproduce? (chances of successful reproduce after running the self contained code)
Level of RxSwift knowledge:
(this is so we can understand your level of knowledge
and formulate the response in an appropriate manner)
The text was updated successfully, but these errors were encountered: