ConfigMock.mocks only use the first mock, right?
Hi, I see
ConfigMock. mocks: [FireMockProtocol]
is an array, but in FireURLProtocol only the first element in the array is used
configMock.mocks.first
Hi,
You right, the first element is used. This is an array because it allows to switch to the other elements with the custom view provide by the framework : FireMock.presentMockRegisters(from: self, backTapped: nil)
With this line, you can switch to other mocks added on registers function at runtime.
Oh, I see. But I think FireURLProtocol should also check for all elements in the array to get the first appropriate mock in case no mock is selected from view :)
By default the first mock registers in variadic parameter is selected. Because It's impossible to know which mock is appropriate, the first mock added is selected on the view and used at launch.