Skip to content

Conversation

@gobetti
Copy link
Contributor

@gobetti gobetti commented Oct 22, 2018

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

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"
Copy link
Contributor Author

@gobetti gobetti Oct 22, 2018

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]? {
Copy link
Contributor Author

@gobetti gobetti Oct 22, 2018

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.

Copy link
Member

@ashfurrow ashfurrow left a 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!

@fernandocruz
Copy link

good job @gobetti 👍

import RxTest
import RxNimble

class RxNimbleRxTestTests: QuickSpec {
Copy link
Contributor Author

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!

@pietrocaselani
Copy link

This is great @gobetti !!

@gobetti
Copy link
Contributor Author

gobetti commented Oct 30, 2018

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!

@ashfurrow ashfurrow merged commit c421ee6 into RxSwiftCommunity:master Nov 1, 2018
@ashfurrow
Copy link
Member

@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 🙇

@rxswiftcommunity
Copy link

Thanks a lot for contributing @gobetti! I've invited you to join the
RxSwiftCommunity GitHub organization – no pressure to accept! If you'd like
more information on what this means, check out our contributor guidelines
and feel free to reach out with any questions.

Generated by 🚫 dangerJS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants