cauliframework / cauli

Debug Networking
https://cauli.works
MIT License
28 stars 5 forks source link

Allow MockFloret resources to be outside of bundle #226

Open lukaswuerzburger opened 3 years ago

lukaswuerzburger commented 3 years ago

In my current project I don't want to add the files to the Xcode project. I only need it temporary for the simulator.

mockFloret.addMapping(forUrl: url) { (_, floret) -> Cauliframework.Result<Response>? in
    floret.resultForPath("/Users/me/Desktop/mock-data/GET_my-endpoint") // This is not possible
}

We could deprecate the method resultForPath and instead introduce two new methods resultForFilePath and resultForBundlePath.

It's also hard to understand that the mock data has to be in a folder called "MockFloret". But that is probably being covered in #166