alexliesenfeld / httpmock

HTTP mocking library for Rust.
MIT License
436 stars 38 forks source link

Is it possible to start multiple mock servers on different ports? #5

Closed jeremyandrews closed 4 years ago

jeremyandrews commented 4 years ago

I'm testing redirects, and would like to test redirecting between servers. Is it possible to start multiple mock servers on different ports?

alexliesenfeld commented 4 years ago

At the moment this feature is not direclty provided by httpmock. Until now there was no use case for having multiple servers running in one test. I will consider adding such a feature in future though.

jeremyandrews commented 4 years ago

Thanks!

Is there a way to then create mock endpoints with this second server (and the default server at the same time)? I've not yet figured out how this would work.

alexliesenfeld commented 4 years ago

Unfortunately not. This is why I have edited my previous comment. I realized that too late. Sorry for the confusion. I will add this feature to my todo list though.

alexliesenfeld commented 4 years ago

This feature should be covered by #7.

jeremyandrews commented 3 years ago

Just following up to let you know this worked perfectly for my project: https://github.com/tag1consulting/goose/pull/112 -- thanks!

alexliesenfeld commented 3 years ago

Thanks for the good feedback! Glad it worked for you!