Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
add test for variable map
Browse files Browse the repository at this point in the history
  • Loading branch information
Russell Stephens committed Sep 4, 2018
1 parent 5090069 commit 2d2b156
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions SnailTests/VariableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,19 @@ class VariableTests: XCTestCase {
XCTAssertTrue(firedCount == 1)
}

func testVariableFireCounts() {
let subject = Variable("one")
var firedCount = 0

subject.map { $0.count }.asObservable().subscribe(onNext: { _ in
firedCount += 1
})

subject.value = "two"

XCTAssertTrue(firedCount == 2)
}

func testMapToVoid() {
let subject = Variable("initial")
var fired = false
Expand Down

0 comments on commit 2d2b156

Please sign in to comment.