Mockingbird Documentation 0.18.0

Classes

Argument​Captor

Captures method arguments passed during mock invocations.

Argument​Matcher

Matches argument values with a comparator.

Non​Escaping​Closure

Placeholder for non-escaping closure parameter types.

Context

Container for mock state and metadata.

Any​Declaration

Mockable declarations.

Variable​Declaration

Mockable variable declarations.

Property​Getter​Declaration

Mockable property getter declarations.

Property​Setter​Declaration

Mockable property setter declarations.

Function​Declaration

Mockable function declarations.

Throwing​Function​Declaration

Mockable throwing function declarations.

Subscript​Declaration

Mockable subscript declarations.

Subscript​Getter​Declaration

Mockable subscript getter declarations.

Subscript​Setter​Declaration

Mockable subscript setter declarations.

Static​Mock

Used to store invocations on static or class scoped methods.

Mocking​Context

Stores invocations received by mocks.

Dynamic​Stubbing​Manager

An intermediate object used for stubbing Objective-C declarations returned by given.

Invocation​Recorder

Records invocations for stubbing and verification.

Proxy​Context

Stores potential targets that can handle forwarded invocations from mocked calls.

Static​Stubbing​Manager

An intermediate object used for stubbing Swift declarations returned by given.

Stubbing​Manager

An intermediate object used for stubbing declarations returned by given.

Error​Box

Used to forward errors thrown from stubbed implementations to the Objective-C runtime.

Swift​Error​Box

Holds Swift errors which are bridged to NSErrors.

Obj​CError​Box

Holds Objective-C NSError objects.

Stubbing​Context

Stores stubbed implementations used by mocks.

Obj​CInvocation

An invocation recieved by an Objective-C.

Verification​Manager

An intermediate object used for verifying declarations returned by verify.

Structures

Count​Matcher

Checks whether a number matches some expected count.

Mockable

Represents a mocked declaration that can be stubbed or verified.

Mock​Metadata

Stores information about generated mocks.

Implementation​Provider

Provides implementation functions used to stub behavior and return values.

Forwarding​Context

Intermediary object for binding forwarding targets to a mock.

Value​Provider

Provides concrete instances of types.

Source​Location

References a line of code in a file.

Ordered​Verification​Options

Additional options to increase the strictness of inOrder verification blocks.

Enumerations

Invocation​Recorder.​Mode

Used to attribute declarations to stubbing and verification calls in tests.

Stubbing​Manager.​Transition​Strategy

When to use the next chained implementation provider.

Selector​Type

Attributes selectors to a specific member type.

Protocols

Declaration

All mockable declaration types conform to this protocol.

Mock

All generated mocks conform to this protocol.

Providable

A type that can provide concrete instances of itself.

Test​Failer

A type that can handle test failures emitted by Mockingbird.

Functions

arg(_:​at:​)

Specifies the argument position for an argument matcher.

first​Arg(_:​)

Specifies the first argument position for an argument matcher.

second​Arg(_:​)

Specifies the second argument position for an argument matcher.

third​Arg(_:​)

Specifies the third argument position for an argument matcher.

fourth​Arg(_:​)

Specifies the fourth argument position for an argument matcher.

fifth​Arg(_:​)

Specifies the fifth argument position for an argument matcher.

any(_:​containing:​)

Matches any collection containing all of the values.

any(_:​containing:​)

Matches any dictionary containing all of the values.

any(_:​keys:​)

Matches any dictionary containing all of the keys.

any(_:​count:​)

Matches any collection with a specific number of elements.

not​Empty(_:​)

Matches any collection with at least one element.

around(_:​tolerance:​)

Matches floating point arguments within some tolerance.

exactly(_:​)

Matches an exact count.

at​Least(_:​)

Matches greater than or equal to some count.

at​Most(_:​)

Matches less than or equal to some count.

between(_:​)

Matches counts that fall within some range.

not(_:​)

Negate a count matcher, only passing on non-matching counts.

not(_:​)

Negate an exact count, only passing on non-matching counts.

any(_:​)

Matches all argument values.

any(_:​)

Matches all Objective-C object argument values.

any(_:​of:​)

Matches argument values equal to any of the provided values.

any(_:​of:​)

Matches argument values identical to any of the provided values.

any(_:​where:​)

Matches any argument values where the predicate returns true.

any(_:​where:​)

Matches any Objective-C object argument values where the predicate returns true.

not​Nil(_:​)

Matches any non-nil argument value.

not​Nil(_:​)

Matches any non-nil Objective-C object argument value.

mock(_:​)

Returns a mock of a given Swift type.

mock(_:​)

Returns a dynamic mock of a given Objective-C object type.

reset(_:​)

Remove all recorded invocations and configured stubs.

reset(_:​)

Remove all recorded invocations and configured stubs.

clear​Invocations(on:​)

Remove all recorded invocations.

clear​Invocations(on:​)

Remove all recorded invocations.

clear​Stubs(on:​)

Remove all concrete stubs.

clear​Stubs(on:​)

Remove all concrete stubs.

clear​Default​Values(on:​)

Remove all registered default values.

forward​ToSuper()

Forward calls for a specific declaration to the superclass.

forward(to:​)

Forward calls for a specific declaration to an object.

last​Set​Value(initial:​)

Stubs a variable getter to return the last value received by the setter.

sequence(of:​)

Stub a sequence of values.

sequence(of:​)

Stub a sequence of implementations.

looping​Sequence(of:​)

Stub a looping sequence of values.

looping​Sequence(of:​)

Stub a looping sequence of implementations.

finite​Sequence(of:​)

Stub a finite sequence of values.

finite​Sequence(of:​)

Stub a finite sequence of implementations.

given(_:​)

Stub a declaration to return a value or perform an operation.

given(_:​)

Stub a declaration to return a value or perform an operation.

eventually(_:​_:​)

Create a deferrable test expectation from a block containing verification calls.

in​Order(with:​file:​line:​_:​)

Enforce the relative order of invocations.

verify(_:​file:​line:​)

Verify that a mock recieved a specific invocation some number of times.

verify(_:​file:​line:​)

Verify that a mock recieved a specific invocation some number of times.

swizzle​Test​Failer(_:​)

Change the current global test failer.

Variables

never

A count of zero.

once

A count of one.

twice

A count of two.

Operators

~>

The stubbing operator is used to bind an implementation to an intermediary Stub object.

Extensions

Array
Dictionary
NSObjectProtocol
Optional
Set