Structures

The following structures are available globally.

  • Undocumented

    See more

    Declaration

    Swift

    public struct execTypesCountTuple<T> where T : ExpressibleByIntegerLiteral
  • A data structure that stores information about an assertion when AssertionRecorder is set as the Nimble assertion handler.

    @see AssertionRecorder @see AssertionHandler

    See more

    Declaration

    Swift

    public struct AssertionRecord : CustomStringConvertible
  • Expression represents the closure of the value inside expect(…). Expressions are memoized by default. This makes them safe to call evaluate() multiple times without causing a re-evaluation of the underlying closure.

    Warning

    Since the closure can be any code, Objective-C code may choose to raise an exception. Currently, SyncExpression does not memoize exception raising.

    This provides a common consumable API for matchers to utilize to allow Nimble to change internals to how the captured closure is managed.

    See more

    Declaration

    Swift

    public struct AsyncExpression<Value>
  • Undocumented

    See more

    Declaration

    Swift

    public struct SyncExpectation<Value> : Expectation
  • Undocumented

    See more

    Declaration

    Swift

    public struct AsyncExpectation<Value> : Expectation
  • Expression represents the closure of the value inside expect(…). Expressions are memoized by default. This makes them safe to call evaluate() multiple times without causing a re-evaluation of the underlying closure.

    Warning

    Since the closure can be any code, Objective-C code may choose to raise an exception. Currently, SyncExpression does not memoize exception raising.

    This provides a common consumable API for matchers to utilize to allow Nimble to change internals to how the captured closure is managed.

    See more

    Declaration

    Swift

    public struct Expression<Value>
  • A Matcher is part of the new matcher API that provides assertions to expectations.

    Given a code snippet:

    expect(1).to(equal(2)) ^^^^^^^^ Called a “matcher”

    A matcher consists of two parts a constructor function and the Matcher.

    The Matcher provide the heavy lifting on how to assert against a given value. Internally, matchers are simple wrappers around closures to provide static type information and allow composition and wrapping of existing behaviors.

    In the 2023 Apple Platform releases (macOS 14, iOS 17, watchOS 10, tvOS 17, visionOS 1), Apple renamed NSMatcher to Matcher. In response, we decided to rename Matcher to Matcher.

    See more

    Declaration

    Swift

    public struct Matcher<T>
    extension Matcher: AsyncableMatcher
  • An AsyncMatcher is part of the new matcher API that provides assertions to expectations.

    Given a code snippet:

    expect(1).to(equal(2)) ^^^^^^^^ Called a “matcher”

    A matcher consists of two parts a constructor function and the Matcher.

    The Matcher provide the heavy lifting on how to assert against a given value. Internally, matchers are simple wrappers around closures to provide static type information and allow composition and wrapping of existing behaviors.

    AsyncMatchers serve to allow writing matchers that must be run in async contexts. These can also be used with either Expectations or AsyncExpectations. But these can only be used from async contexts, and are unavailable in Objective-C. You can, however, call regular Matchers from an AsyncMatcher, if you wish to compose one like that.

    See more

    Declaration

    Swift

    public struct AsyncMatcher<T> : AsyncableMatcher
  • Represents nil value to be used with the operator overloads for beNil.

    See more

    Declaration

    Swift

    public struct ExpectationNil : ExpressibleByNilLiteral
  • The value that a Matcher returns to describe if the given (actual) value matches the matcher.

    See more

    Declaration

    Swift

    public struct MatcherResult
  • If you are running on a slower machine, it could be useful to increase the default timeout value or slow down poll interval. Default timeout interval is 1, and poll interval is 0.01.

    Note

    This used to be known as AsyncDefaults.
    See more

    Declaration

    Swift

    public struct PollingDefaults