SyncRequirement

public struct SyncRequirement<Value>

Undocumented

  • Undocumented

    Declaration

    Swift

    public let expression: Expression<Value>
  • A custom error to throw. If nil, then we will throw a RequireError on failure.

    Declaration

    Swift

    public let customError: Error?
  • Undocumented

    Declaration

    Swift

    public var location: SourceLocation { get }
  • Undocumented

    Declaration

    Swift

    public init(expression: Expression<Value>, customError: Error?)
  • Undocumented

    Declaration

    Swift

    public func verify(_ pass: Bool, _ message: FailureMessage, _ value: Value?) throws -> Value
  • Tests the actual value using a matcher to match.

    Declaration

    Swift

    @discardableResult
    public func to(_ matcher: Matcher<Value>, description: String? = nil) throws -> Value
  • Tests the actual value using a matcher to not match.

    Declaration

    Swift

    @discardableResult
    public func toNot(_ matcher: Matcher<Value>, description: String? = nil) throws -> Value
  • Tests the actual value using a matcher to not match.

    Alias to toNot().

    Declaration

    Swift

    @discardableResult
    public func notTo(_ matcher: Matcher<Value>, description: String? = nil) throws -> Value

AsyncMatchers

  • to(_:description:) Asynchronous

    Tests the actual value using a matcher to match.

    Declaration

    Swift

    @discardableResult
    public func to(_ matcher: AsyncMatcher<Value>, description: String? = nil) async throws -> Value
  • toNot(_:description:) Asynchronous

    Tests the actual value using a matcher to not match.

    Declaration

    Swift

    @discardableResult
    public func toNot(_ matcher: AsyncMatcher<Value>, description: String? = nil) async throws -> Value
  • notTo(_:description:) Asynchronous

    Tests the actual value using a matcher to not match.

    Alias to toNot().

    Declaration

    Swift

    @discardableResult
    public func notTo(_ matcher: AsyncMatcher<Value>, description: String? = nil) async throws -> Value

Dispatch Polling with Synchronous Matchers

  • Require the actual value using a matcher to match by checking continuously at each pollInterval until the timeout is reached.

    @discussion This function manages the main run loop (NSRunLoop.mainRunLoop()) while this function is executing. Any attempts to touch the run loop may cause non-deterministic behavior.

    @warning This form of toEventually does not work in any kind of async context. Use the async form of toEventually if you are running tests in an async context.

    Declaration

    Swift

    @available(*, noasync, message: "the sync variant of `toEventually` does not work in async contexts. Use the async variant as a drop-in replacement")
    @discardableResult
    public func toEventually(_ matcher: Matcher<Value>, timeout: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) throws -> Value
  • Tests the actual value using a matcher to not match by checking continuously at each pollInterval until the timeout is reached.

    @discussion This function manages the main run loop (NSRunLoop.mainRunLoop()) while this function is executing. Any attempts to touch the run loop may cause non-deterministic behavior.

    @warning This form of toEventuallyNot does not work in any kind of async context. Use the async form of toEventuallyNot if you are running tests in an async context.

    Declaration

    Swift

    @available(*, noasync, message: "the sync variant of `toEventuallyNot` does not work in async contexts. Use the async variant as a drop-in replacement")
    @discardableResult
    public func toEventuallyNot(_ matcher: Matcher<Value>, timeout: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) throws -> Value
  • Tests the actual value using a matcher to not match by checking continuously at each pollInterval until the timeout is reached.

    Alias of toEventuallyNot()

    @discussion This function manages the main run loop (NSRunLoop.mainRunLoop()) while this function is executing. Any attempts to touch the run loop may cause non-deterministic behavior.

    @warning This form of toNotEventually does not work in any kind of async context. Use the async form of toNotEventually if you are running tests in an async context.

    Declaration

    Swift

    @available(*, noasync, message: "the sync variant of `toNotEventually` does not work in async contexts. Use the async variant as a drop-in replacement")
    @discardableResult
    public func toNotEventually(_ matcher: Matcher<Value>, timeout: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) throws -> Value
  • Tests the actual value using a matcher to never match by checking continuously at each pollInterval until the timeout is reached.

    @discussion This function manages the main run loop (NSRunLoop.mainRunLoop()) while this function is executing. Any attempts to touch the run loop may cause non-deterministic behavior.

    @warning This form of toNever does not work in any kind of async context. Use the async form of toNever if you are running tests in an async context.

    Declaration

    Swift

    @available(*, noasync, message: "the sync variant of `toNever` does not work in async contexts. Use the async variant as a drop-in replacement")
    @discardableResult
    public func toNever(_ matcher: Matcher<Value>, until: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) throws -> Value
  • Tests the actual value using a matcher to never match by checking continuously at each pollInterval until the timeout is reached.

    Alias of toNever()

    @discussion This function manages the main run loop (NSRunLoop.mainRunLoop()) while this function is executing. Any attempts to touch the run loop may cause non-deterministic behavior.

    @warning This form of neverTo does not work in any kind of async context. Use the async form of neverTo if you are running tests in an async context.

    Declaration

    Swift

    @available(*, noasync, message: "the sync variant of `neverTo` does not work in async contexts. Use the async variant as a drop-in replacement")
    @discardableResult
    public func neverTo(_ matcher: Matcher<Value>, until: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) throws -> Value
  • Tests the actual value using a matcher to always match by checking continusouly at each pollInterval until the timeout is reached

    @discussion This function manages the main run loop (NSRunLoop.mainRunLoop()) while this function is executing. Any attempts to touch the run loop may cause non-deterministic behavior.

    @warning This form of toAlways does not work in any kind of async context. Use the async form of toAlways if you are running tests in an async context.

    Declaration

    Swift

    @available(*, noasync, message: "the sync variant of `toAlways` does not work in async contexts. Use the async variant as a drop-in replacement")
    @discardableResult
    public func toAlways(_ matcher: Matcher<Value>, until: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) throws -> Value
  • Tests the actual value using a matcher to always match by checking continusouly at each pollInterval until the timeout is reached

    Alias of toAlways()

    @discussion This function manages the main run loop (NSRunLoop.mainRunLoop()) while this function is executing. Any attempts to touch the run loop may cause non-deterministic behavior.

    @warning This form of alwaysTo does not work in any kind of async context. Use the async form of alwaysTo if you are running tests in an async context.

    Declaration

    Swift

    @available(*, noasync, message: "the sync variant of `alwaysTo` does not work in async contexts. Use the async variant as a drop-in replacement")
    @discardableResult
    public func alwaysTo(_ matcher: Matcher<Value>, until: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) throws -> Value

Async Polling with Synchronous Matchers

Async Polling With AsyncMatchers