Stubber

public struct Stubber<ReturnedValue>

Used to populate stubbed method with sequence of events. Call it’s methods, to record subsequent stub return values.

  • Stubbing policy. If wrap - it will iterate over recorded values. If drop - it will remove value when stub returns. If default - it will use mock settings

    Declaration

    Swift

    public var policy: StubbingPolicy { get set }
  • [Internal] New instance of stubber class, used to populate products array

    Declaration

    Swift

    public init(_ method: StubbedMethod, returning: ReturnedValue.Type)

    Parameters

    method

    Stubbed method

    returning

    Return

  • Record return value

    Declaration

    Swift

    public func `return`(_ value: ReturnedValue)

    Parameters

    value

    return value

  • Record subsequent return values, in given order (comma separated)

    Declaration

    Swift

    public func `return`(_ values: ReturnedValue...)

    Parameters

    values

    return values