File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 10
10
11
11
import Foundation
12
12
import XCTest
13
+ #if canImport(FoundationNetworking)
14
+ import FoundationNetworking
15
+ #endif
13
16
14
17
/// A Mock which can be used for mocking data requests with the `Mocker` by calling `Mocker.register(...)`.
15
18
public struct Mock : Equatable {
Original file line number Diff line number Diff line change 7
7
//
8
8
9
9
import Foundation
10
+ #if canImport(FoundationNetworking)
11
+ import FoundationNetworking
12
+ #endif
10
13
11
14
/// Can be used for registering Mocked data, returned by the `MockingURLProtocol`.
12
15
public struct Mocker {
@@ -73,7 +76,7 @@ public struct Mocker {
73
76
74
77
private init ( ) {
75
78
// Whenever someone is requesting the Mocker, we want the URL protocol to be activated.
76
- URLProtocol . registerClass ( MockingURLProtocol . self)
79
+ _ = URLProtocol . registerClass ( MockingURLProtocol . self)
77
80
}
78
81
79
82
/// Register new Mocked data. If a mock for the same URL and HTTPMethod exists, it will be overwritten.
Original file line number Diff line number Diff line change 7
7
//
8
8
9
9
import Foundation
10
+ #if canImport(FoundationNetworking)
11
+ import FoundationNetworking
12
+ #endif
10
13
11
14
/// The protocol which can be used to send Mocked data back. Use the `Mocker` to register `Mock` data
12
15
open class MockingURLProtocol : URLProtocol {
You can’t perform that action at this time.
0 commit comments