mosamer / RxTestExt

A collection of operators & tools not found in the core RxTest distribution

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RxTestExt

CircleCI pod

A collection of operators & tools not found in the core RxTest distribution.

Usage

RxTestExt can be used for common unit testing tasks like,

  • recording events from an observable into a Testable Observer
  • binding an array of recorded events (timeline) to an Observer or a Relay.
  • assert that recorded events match specific criteria.

For example:

func testSomething() {
   let source = scheduler.record(source: someObservable)
   scheduler.bind([next(10, "alpha"), completed(10)],
                  to: someObserver)
   scheduler.start()
   assert(source).next()
   assert(source).not.error()
}

Features

  • Scheduler subscription extensions
    • record observable events into a TestableObserver.
    • bind recorded events to an Observer or a Relay.
  • Rx Timeline matchers functions
    • assert TestableObserver recorded next events.
    • assert TestableObserver received error events.
    • assert TestableObserver received complete events.

About

A collection of operators & tools not found in the core RxTest distribution

License:MIT License


Languages

Language:Swift 96.2%Language:Ruby 3.8%