From 08350920b54c220a038e38bde0d84bd6126488dd Mon Sep 17 00:00:00 2001 From: Srdan Rasic Date: Mon, 19 Aug 2019 07:48:24 +0200 Subject: [PATCH] Add test case. --- Tests/ReactiveKitTests/SignalTests.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Tests/ReactiveKitTests/SignalTests.swift b/Tests/ReactiveKitTests/SignalTests.swift index b2c3bb6..1fdceb0 100644 --- a/Tests/ReactiveKitTests/SignalTests.swift +++ b/Tests/ReactiveKitTests/SignalTests.swift @@ -227,6 +227,18 @@ class SignalTests: XCTestCase { takenLast2.expectComplete(after: [2, 3]) } + func testTakeFirstOne() { + let expect = expectation(description: #function) + let observable = Property(false) + + _ = observable.take(first: 1).collect().observeNext { values in + XCTAssertEqual([false], values) + expect.fulfill() + } + + waitForExpectations(timeout: 1, handler: nil) + } + func testTakeUntil() { let bob = Scheduler() let eve = Scheduler()