Repository navigation
Conversation
|
@ayanko @bblimke here is a rough POC showing how to use an endpoint and an internal HTTP connection/server (using HTTP2 by default) to easily intercept requests. It's inspired by @ayanko's webmock implementation, but I wanted to try and standardise some of it. The next step is to try and figure out what Personally, while 2/ is simpler, the chance of it breaking things is higher, because we'd need to correctly proxy WebSockets, HTTPS, etc, it's basically a man in the middle. But because of that, it's a centralised place for the logic to go. It's all in the same process. @ayanko see #35 for more discussion if you are interested. |
|
The other part of this, is the ability to replace It would be nice if it was possible to only make these changes when working within the spec, but this would require injecting That being said, it would be nice if we split the WebMock support for Async into two parts - those that are fairly pure and require injection, and those which just do the constant replacement. That way, engineer's writing tests can decide for themselves what approach works best for them, and the former approach, I'd be happy to completely support within |
|
I realised a slightly better implementation might be: Using a unix pipe avoids all the in-process queues and behaves more like a standard I/O. |
f67783f to
3ff77a7
Compare
This provides some basic building blocks for mocking up
Async::HTTP::Clientin the same process.#35