Mockingbird Documentation 0.15.0

Classes

Argument​Captor

Captures method arguments passed during mock invocations.

Argument​Matcher

Matches argument values with a comparator.

Static​Mock

Used to store invocations on static or class scoped methods.

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.

Mocking​Context

Stores invocations received by mocks.

Stubbing​Manager

An intermediate object used for stubbing declarations returned by given.

Stubbing​Context

Stores stubbed implementations used by mocks.

Non​Escaping​Closure

Placeholder for non-escaping closure parameter types.

Structures

Count​Matcher

Checks whether a number matches some expected count.

Mock​Metadata

Stores information about generated mocks.

Mockable

Represents a mocked declaration that can be stubbed or verified.

Implementation​Provider

Provides implementation functions used to stub behavior and return values.

Value​Provider

Provides concrete instances of types.

Symbol​Print​Options

These options mimic those used in the Swift project. Check that project for details.

Swift​Symbol
Source​Location

References a line of code in a file.

Ordered​Verification​Options

Additional options to increase the strictness of inOrder verification blocks.

Verification​Manager

An intermediate object used for verifying declarations returned by verify.

Enumerations

Stubbing​Manager.​Transition​Strategy

When to use the next chained implementation provider.

Swift​Symbol.​Contents
Swift​Symbol.​Kind
Swift​Symbol​Parse​Error

A type for representing the different possible failure conditions when using ScalarScanner

Protocols

Mock

All generated mocks conform to this protocol.

Declaration

All mockable declaration types 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

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(_:​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.

not​Nil(_:​)

Matches any non-nil argument value.

mock(_:​)

Returns a mock of a given type.

reset(_:​)

Remove all recorded invocations and configured stubs.

clear​Invocations(on:​)

Remove all recorded invocations.

clear​Stubs(on:​)

Remove all concrete stubs.

clear​Default​Values(on:​)

Remove all registered default values.

use​Default​Values(from:​on:​)

Start returning default values for unstubbed methods on multiple mocks.

use​Default​Values(from:​on:​)

Start returning default values for unstubbed methods on a single mock.

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.

last​Set​Value(initial:​)

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

given(_:​)

Stub one or more declarations to return a value or perform an operation.

parse​Mangled​Swift​Symbol(_:​is​Type:​)

This is likely to be the primary entry point to this file. Pass a string containing a Swift mangled symbol or type, get a parsed SwiftSymbol structure which can then be directly examined or printed.

parse​Mangled​Swift​Symbol(_:​is​Type:​symbolic​Reference​Resolver:​)

Pass a collection of UnicodeScalars containing a Swift mangled symbol or type, get a parsed SwiftSymbol structure which can then be directly examined or printed.

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.

swizzle​Test​Failer(_:​)

Change the current global test failer.

MKBFail(_:​is​Fatal:​file:​line:​)

Called by Mockingbird on test assertion failures.

Variables

never

A count of zero.

once

A count of one.

twice

A count of two.