Stubbed function should be allow tor return 'nil'. Suggest to make result param optional.
|
/// Returns new result instead of default |
|
/// |
|
/// - Parameter result: New result. |
|
/// - Returns: A stub for chained call. |
|
@discardableResult |
|
public func thenReturn(_ result: Any) -> Stub { |
|
let stubAction = StubAction { (_) -> Any? in |
|
return result |
|
} |
|
actions.append(stubAction) |
|
return self |
|
} |