Skip to content

Commit

Permalink
verify that the error was sent until hitting the limitation
Browse files Browse the repository at this point in the history
  • Loading branch information
jun_tanaka555 committed Aug 3, 2017
1 parent 64bd5f6 commit 73d2d4d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Tests/ReactiveSwiftTests/SignalProducerSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2020,6 +2020,7 @@ class SignalProducerSpec: QuickSpec {
let scheduler = TestScheduler()
var count = 0
var values: [Int] = []
var errors: [TestError] = []

let original = SignalProducer<Int, TestError> { observer, _ in
scheduler.schedule { observer.send(value: count) }
Expand All @@ -2032,6 +2033,8 @@ class SignalProducerSpec: QuickSpec {
switch event {
case let .value(value):
values.append(value)
case let .failed(error):
errors.append(error)
default:
break
}
Expand All @@ -2040,18 +2043,22 @@ class SignalProducerSpec: QuickSpec {
scheduler.advance()
expect(count) == 1
expect(values) == [1]
expect(errors) == []

scheduler.advance(by: .seconds(1))
expect(count) == 2
expect(values) == [1, 2]
expect(errors) == []

scheduler.advance(by: .seconds(1))
expect(count) == 3
expect(values) == [1, 2, 3]
expect(errors) == [.default]

scheduler.advance(by: .seconds(1))
expect(count) == 3
expect(values) == [1, 2, 3]
expect(errors) == [.default]
}

}
Expand Down

0 comments on commit 73d2d4d

Please sign in to comment.