Mockingbird Documentation 0.18.0

Class Stubbing​Context

@objc(MKBStubbingContext) public class StubbingContext: NSObject  

Stores stubbed implementations used by mocks.

StubbingContext StubbingContext NSObject NSObject StubbingContext->NSObject

Conforms To

NSObject

Properties

no​Implementation

@objc public static let noImplementation  

Used to indicate that no implementation exists for a given invocation.

Methods

evaluate​Return​Value(for:​)

@objc public func evaluateReturnValue(for invocation: ObjCInvocation) -> Any?  

Apply arguments to a Swift implementation forwarded by the Objective-C runtime.

Invocations with more than 10 arguments will throw a missing stubbed implementation error.

Parameters

invocation Obj​CInvocation

An Objective-C invocation to handle.

Returns

The value returned from evaluating the Swift implementation.

provide​Default​Value(for:​)

@objc public func provideDefaultValue(for invocation: ObjCInvocation) -> Any?  

Attempts to return a value using the default value provider.

Parameters

invocation Obj​CInvocation

An Objective-C invocation to handle.

Returns

A value or nil if the provider could not handle the Objective-C return type.

fail​Test(for:​)

@objc public func failTest(for invocation: ObjCInvocation) -> Never