Structures
The following structures are available globally.
-
Undocumented
See moreDeclaration
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 moreDeclaration
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 moreDeclaration
Swift
public struct AsyncExpression<Value>
-
Undocumented
See moreDeclaration
Swift
public struct SyncExpectation<Value> : Expectation
-
Undocumented
See moreDeclaration
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 moreDeclaration
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
See moreNSMatcher
toMatcher
. In response, we decided to renameMatcher
toMatcher
.Declaration
-
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.
See moreAsyncMatcher
s serve to allow writing matchers that must be run in async contexts. These can also be used with eitherExpectation
s orAsyncExpectation
s. 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.Declaration
Swift
public struct AsyncMatcher<T> : AsyncableMatcher
-
Represents
See morenil
value to be used with the operator overloads forbeNil
.Declaration
Swift
public struct ExpectationNil : ExpressibleByNilLiteral
-
The value that a Matcher returns to describe if the given (actual) value matches the matcher.
See moreDeclaration
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 asAsyncDefaults
.Declaration
Swift
public struct PollingDefaults