From 567d48aefac5b117b04b6e1332bfd2d55eb0535d Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Sun, 30 Apr 2023 15:25:09 +0200 Subject: [PATCH] Made the MockURLProtocol class available for non Apple platforms by importing the FoundationNetworking framework. --- Sources/Communications/Classes/MockURLProtocol.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sources/Communications/Classes/MockURLProtocol.swift b/Sources/Communications/Classes/MockURLProtocol.swift index f4122a6..e634324 100644 --- a/Sources/Communications/Classes/MockURLProtocol.swift +++ b/Sources/Communications/Classes/MockURLProtocol.swift @@ -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