Skip to content
Permalink
Browse files

Tests: Rename O to Observer when applicable

  • Loading branch information...
freak4pc authored and kzaher committed Apr 24, 2019
1 parent 05e27bc commit 1dbb9343a75115ab3b0ba3e65734ce1faceab279
@@ -11,7 +11,7 @@ import XCTest
import Dispatch

final class BackgroundThreadPrimitiveHotObservable<Element: Equatable> : PrimitiveHotObservable<Element> {
override func subscribe<O : ObserverType>(_ observer: O) -> Disposable where O.Element == Element {
override func subscribe<Observer: ObserverType>(_ observer: Observer) -> Disposable where Observer.Element == Element {
XCTAssertTrue(!DispatchQueue.isMain)
return super.subscribe(observer)
}
@@ -11,7 +11,7 @@ import XCTest
import Dispatch

final class MainThreadPrimitiveHotObservable<Element: Equatable> : PrimitiveHotObservable<Element> {
override func subscribe<O : ObserverType>(_ observer: O) -> Disposable where O.Element == Element {
override func subscribe<Observer: ObserverType>(_ observer: Observer) -> Disposable where Observer.Element == Element {
XCTAssertTrue(DispatchQueue.isMain)
return super.subscribe(observer)
}
@@ -39,7 +39,7 @@ final class MySubject<Element> : SubjectType, ObserverType where Element : Hasha
}
}

func subscribe<O : ObserverType>(_ observer: O) -> Disposable where O.Element == Element {
func subscribe<Observer: ObserverType>(_ observer: Observer) -> Disposable where Observer.Element == Element {
_subscribeCount += 1
_observer = AnyObserver(observer)

@@ -37,7 +37,7 @@ class PrimitiveHotObservable<Element> : ObservableType {
_observers.on(event)
}

func subscribe<O : ObserverType>(_ observer: O) -> Disposable where O.Element == Element {
func subscribe<Observer: ObserverType>(_ observer: Observer) -> Disposable where Observer.Element == Element {
lock.lock()
defer { lock.unlock() }

@@ -21,7 +21,7 @@ final class TestConnectableObservable<Subject: SubjectType> : ConnectableObserva
return _o.connect()
}

func subscribe<O : ObserverType>(_ observer: O) -> Disposable where O.Element == Element {
func subscribe<Observer: ObserverType>(_ observer: Observer) -> Disposable where Observer.Element == Element {
return _o.subscribe(observer)
}
}

0 comments on commit 1dbb934

Please sign in to comment.
You can’t perform that action at this time.