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 Predicate 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 Predicate. The term Predicate is used as a separate name from Matcher to help transition custom matchers to the new Nimble matcher API.
The Predicate provide the heavy lifting on how to assert against a given value. Internally, predicates are simple wrappers around closures to provide static type information and allow composition and wrapping of existing behaviors.
See moreDeclaration
-
An AsyncPredicate 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 Predicate. The term Predicate is used as a separate name from Matcher to help transition custom matchers to the new Nimble matcher API.
The Predicate provide the heavy lifting on how to assert against a given value. Internally, predicates are simple wrappers around closures to provide static type information and allow composition and wrapping of existing behaviors.
See moreAsyncPredicate
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 Predicates from an AsyncPredicate, if you wish to compose one like that.Declaration
Swift
public struct AsyncPredicate<T> : AsyncablePredicate
-
Represents
See morenil
value to be used with the operator overloads forbeNil
.Declaration
Swift
public struct ExpectationNil : ExpressibleByNilLiteral
-
The value that a Predicates return to describe if the given (actual) value matches the predicate.
See moreDeclaration
Swift
public struct PredicateResult
-
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.
Warning
This has been renamed toPollingDefaults
. Starting in Nimble 13, the deprecation warning will change to a compiler error (removed). In Nimble 14,AsyncDefaults
will be removed entirely.For the time being,
See moreAsyncDefaults
will function the same. However,AsyncDefaults
will be removed in a future release.Declaration
Swift
@available(*, deprecated, renamed: "PollingDefaults") public struct AsyncDefaults
-
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
See moreAsyncDefaults
.Declaration
Swift
public struct PollingDefaults