-
Notifications
You must be signed in to change notification settings - Fork 69
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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