Skip to content

Commit

Permalink
Document that onRequest and completion must be set before calling reg…
Browse files Browse the repository at this point in the history
…ister() (#47)
  • Loading branch information
Marc Etcheverry authored Mar 10, 2020
1 parent a38a350 commit a7ddd48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Mock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ public struct Mock: Equatable {
/// Add a delay to a certain mock, which makes the response returned later.
public var delay: DispatchTimeInterval?

/// The callback which will be executed everytime this `Mock` was completed. Can be used within unit tests for validating that a request has been executed.
/// The callback which will be executed everytime this `Mock` was completed. Can be used within unit tests for validating that a request has been executed. The callback must be set before calling `register`.
public var completion: (() -> Void)?

/// The callback which will be executed everytime this `Mock` was started. Can be used within unit tests for validating that a request has been started.
/// The callback which will be executed everytime this `Mock` was started. Can be used within unit tests for validating that a request has been started. The callback must be set before calling `register`.
public var onRequest: OnRequest?

private init(url: URL? = nil, ignoreQuery: Bool = false, dataType: DataType, statusCode: Int, data: [HTTPMethod: Data], additionalHeaders: [String: String] = [:], fileExtensions: [String]? = nil) {
Expand Down

0 comments on commit a7ddd48

Please sign in to comment.