Added support to RxTest#35
Conversation
Users of RxNimble may now opt between RxBlocking and RxTest (mutually or exclusively). In order to keep compability with previous versions, the `default_subspec` is "RxBlocking", but "RxNimble/RxTest" can be added to clients' Podfiles, or replace "RxNimble" entirely in order to remove the dependency on `RxBlocking`.
| s.dependency "Nimble", "~> 7.0" | ||
| s.dependency "RxSwift", "~> 4.2" | ||
| s.dependency "RxBlocking", "~> 4.0" | ||
| s.default_subspec = "RxBlocking" |
There was a problem hiding this comment.
I'm doing this for compatibility reasons only, but I honestly recommend to use RxTest instead of RxBlocking. We could consider changing the default to RxTest in v5.0, perhaps?!
| /// A Nimble matcher that succeeds when the actual events emit an error | ||
| /// of any type. | ||
| public func throwError<T: Equatable>() -> Predicate<RecordedEvents<T>> { | ||
| func extractError(_ recorded: RecordedEvents<T>?) -> [Error]? { |
There was a problem hiding this comment.
I could avoid having extracted this to a function, but I wanted to isolate swift version checks (flatMap vs. compactMap) without repeating myself too much.
800c78b to
915f1be
Compare
915f1be to
8cea849
Compare
ashfurrow
left a comment
There was a problem hiding this comment.
Impressive work! I was initially confused about what RxTest is, but you've ticked off all the boxes for a the idea pull request:
- Test coverage.
- Documentation updates.
- Changelog entry.
- Clean and simple implementation.
- New code is commented.
- Backwards compatible.
Let's give folks a day or so to review, but I'm happy with merging 👍 Thank you!
|
good job @gobetti 👍 |
| import RxTest | ||
| import RxNimble | ||
|
|
||
| class RxNimbleRxTestTests: QuickSpec { |
There was a problem hiding this comment.
probably the worst tests class name ever - absolutely open to suggestions!
|
This is great @gobetti !! |
|
Hi @ashfurrow ! I'm adding Carthage support to RxNimble and I should be good to open a PR in the next days, however as you can guess, it will hugely conflict with this one here. Do you think we can have this merged soon, or would you rather have the Carthage one merged first and then we can think about RxTest later? Thank you! |
|
@gobetti ah, sorry this feel through the cracks! It's been a busy week. I've merged, and I look forward to your next PR! Thanks again 🙇 |
|
Thanks a lot for contributing @gobetti! I've invited you to join the Generated by 🚫 dangerJS |
The title summarizes it already, but you can have a better overview of what is actually being added here by checking the unit tests in RxNimbleRxTestTests.swift