Skip to content
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

Recorder.availableElements #11

Merged
merged 4 commits into from
Dec 23, 2020
Merged

Recorder.availableElements #11

merged 4 commits into from
Dec 23, 2020

Conversation

groue
Copy link
Owner

@groue groue commented Dec 23, 2020

Recorder.availableElements is an expectation that returns all published elements until timeout expiration.

For example:

// SUCCESS: no timeout, no error
func testTimerPublishesIncreasingDates() throws {
    let publisher = Timer.publish(every: 0.01, on: .main, in: .common).autoconnect()
    let recorder = publisher.record()
    let dates = try wait(for: recorder.availableElements, timeout: ...)
    XCTAssertEqual(dates.sorted(), dates)
}

Fixes #8

@groue groue added the enhancement New feature or request label Dec 23, 2020
@groue groue changed the base branch from master to development December 23, 2020 17:37
@groue groue merged commit ec00c16 into development Dec 23, 2020
@groue groue deleted the availableElements branch December 23, 2020 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expectation that returns the set of elements without requiring completion
1 participant