[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:
2023-04-30 13:28:32 +00:00
parent fb439a82a8
commit 2f3712c830
2 changed files with 6 additions and 4 deletions
@@ -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