Compare commits
1 Commits
master
...
fix/objc-n
Author | SHA1 | Date |
---|---|---|
![]() |
5bb308952e |
|
@ -68,6 +68,18 @@ public extension StubRecorder where OUT: NSObject {
|
|||
}
|
||||
}
|
||||
|
||||
public extension StubRecorder where OUT: NSObjectProtocol {
|
||||
func thenReturn(_ object: OUT) {
|
||||
recorder.andReturn(object)
|
||||
}
|
||||
}
|
||||
|
||||
public extension StubRecorder where OUT == Optional<NSObjectProtocol> {
|
||||
func thenReturn(_ object: OUT) {
|
||||
recorder.andReturn(object)
|
||||
}
|
||||
}
|
||||
|
||||
public extension StubRecorder where OUT: CuckooOptionalType, OUT.Wrapped: NSObject {
|
||||
func thenReturn(_ object: OUT) {
|
||||
recorder.andReturn(object)
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
//
|
||||
// ObjectiveExamplesTest.swift
|
||||
// Cuckoo_OCMock-iOSTests
|
||||
//
|
||||
// Created by Matyáš Kříž on 31/07/2020.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
import Cuckoo
|
||||
|
||||
import CoreBluetooth
|
||||
|
||||
class ObjectiveExamplesTest: XCTestCase {
|
||||
func testProperties() {
|
||||
let mock = objcStub(for: CBCentralManager.self) { stubber, mock in
|
||||
stubber.when(mock.delegate).thenReturn(nil)
|
||||
}
|
||||
|
||||
let g = mock.delegate
|
||||
|
||||
objcVerify(mock.delegate)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue