Created
December 11, 2022 23:52
-
-
Save thepearl/3e934ee968cbcf16af685b9efe7330c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let expectedOutput = "Hello, World!" | |
let publisher = SomePublisher<String, Error>() | |
let cancellable = publisher | |
.sink(receiveCompletion: { completion in | |
switch completion { | |
case .finished: | |
break | |
case .failure(let error): | |
XCTFail("Publisher failed with error: \(error)") | |
} | |
}, receiveValue: { value in | |
XCTAssertEqual(value, expectedOutput) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment