[Enhancement] Communications library for non Apple platforms (part II) (#16)
This PR contains the work done to make the `MockURLProtocol` class from the `Communications` library available for non-Apple platforms. Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Reviewed-on: #16
This commit was merged in pull request #16.
This commit is contained in:
@@ -10,9 +10,12 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
|
||||
import Foundation
|
||||
|
||||
#if canImport(FoundationNetworking)
|
||||
import FoundationNetworking
|
||||
#endif
|
||||
|
||||
/// This class overrides the `URLProtocol` protocol used by the `URLSession` to handle the loading of protocol-specific URL data so it is possible to mock URL response for testing purposes.
|
||||
public class MockURLProtocol: URLProtocol {
|
||||
|
||||
@@ -117,4 +120,3 @@ public struct MockURLResponse {
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user