Skip to content

Instantly share code, notes, and snippets.

@TheAdamBorek
Last active February 27, 2017 07:42
Show Gist options
  • Save TheAdamBorek/ffa76257c3642c4cf406ce3bece8a816 to your computer and use it in GitHub Desktop.
Save TheAdamBorek/ffa76257c3642c4cf406ce3bece8a816 to your computer and use it in GitHub Desktop.
func test_receiveImage_onButtonClick_version2() {
let buttonTaps = testScheduler.createHotObservable([next(100, ()), next(200, ())])
buttonTaps.bindTo(subject.chooseImageButtonPressed)
.disposed(by: rx_disposeBag)
let observer = testScheduler.createObserver(UIImage.self)
self.subject.image.drive(observer)
.disposed(by: self.rx_disposeBag)
testScheduler.start()
let expectedEvents = [
next(100, imageHavingMock.expectedImage),
next(200, imageHavingMock.expectedImage)
]
XCTAssertEqual(observer.events, expectedEvents)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment