swifter icon indicating copy to clipboard operation
swifter copied to clipboard

tvOS 16 Beta 2 Unable to override the Stub that has same url

Open rupikasompalli opened this issue 3 years ago • 0 comments

In my project, I use Swifter version 1.5.0 to stub the json responses.

The following code worked find prior to tvOS 16, but broke in tvOS 16

    ```
    let responseFail: ((HttpRequest) -> HttpResponse) = { [weak self] request in
        return .fileResponse("fail_json")
    }
   server.POST[stub.url] = responseFail

      // Some code for tests, and now stub the same url with different response

     let responseSuccess: ((HttpRequest) -> HttpResponse) = { [weak self] request in
        return .fileResponse("success_json")
    }
    server.POST[stub.url] = responseSuccess

    // verify result
In tvOS16 I still get responseFail where I expect responseSuccess.

In tvOS15 and earlier, I get responseSuccess as expected in my last line.

rupikasompalli avatar Jul 07 '22 11:07 rupikasompalli