Inherits from RACScheduler : NSObject
Declared in RACTestScheduler.h

Overview

A special kind of scheduler that steps through virtualized time.

This scheduler class can be used in unit tests to verify asynchronous behaviors without spending significant time waiting.

This class can be used from multiple threads, but only one thread can step through the enqueued actions at a time. Other threads will wait while the scheduled blocks are being executed.

Tasks

  • – init

    Initializes a new test scheduler.

  • – step

    Executes the next scheduled block, if any.

  • – step:

    Executes up to the next ticks scheduled blocks.

  • – stepAll

    Executes all of the scheduled blocks on the receiver.

Instance Methods

init

- (instancetype)init
Discussion

Initializes a new test scheduler.

Declared In

RACTestScheduler.h

step

- (void)step
Discussion

Executes the next scheduled block, if any.

This method will block until the scheduled action has completed.

Declared In

RACTestScheduler.h

step:

- (void)step:(NSUInteger)ticks
Discussion

Executes up to the next ticks scheduled blocks.

This method will block until the scheduled actions have completed.

ticks - The number of scheduled blocks to execute. If there aren’t this many blocks enqueued, all scheduled blocks are executed.

Declared In

RACTestScheduler.h

stepAll

- (void)stepAll
Discussion

Executes all of the scheduled blocks on the receiver.

This method will block until the scheduled actions have completed.

Declared In

RACTestScheduler.h