"Stub HTTP requests" #18
glaucocustodio
started this conversation in
General
Replies: 1 comment 1 reply
-
I prefer to wrap interactions with HTTP services in a Client class, and test that with VCR. The rest of the system is tested against a stub Client. This is both easier for me to use, and helps ensure that all HTTP interactions with an external service happen in one place, making it easy to add logging and instrumentation. I've seen some codebases with http requests sprinkled gratuitously throughout code, and test cases full of http stubs - would not recommend! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What are your thoughts on https://evenbetterspecs.github.io/#stub-http-requests?
Beta Was this translation helpful? Give feedback.
All reactions