-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
possible webmockr integration #174
Conversation
Note from call: consider conditioning the callback on a unique secret header. |
Codecov Report
@@ Coverage Diff @@
## master #174 +/- ##
==========================================
- Coverage 78.81% 78.77% -0.04%
==========================================
Files 35 35
Lines 1369 1376 +7
==========================================
+ Hits 1079 1084 +5
- Misses 290 292 +2
Continue to review full report at Codecov.
|
I'm curious, how does |
If curl would provide a way to explicitly let the handle be mock-able e.g. |
by running
this https://github.com/ropensci/webmockr/blob/adapter-curl/R/curl_mocking.R#L37-L38 will pick up the stub for the matched request signature from |
would make things easier for sure as wouldn't have to run |
closing for now - we talked and decided to not do this |
@jeroen opening this to start a discussion to see if you'd be willing to incorporate changes for
webmockr
- if so, if you have any thoughts on the changes I've made.A few people have requested
curl
integration forwebmockr
, suggesting there's more than that that would use it.I want an even smaller change (few lines of code) to
curl
than I've made in this PR - perhaps you can advise on how.The only thing changed right now in my fork of
curl
iscurl_fetch_memory()
: I first check ifwebmockr
is installed, if not move on. If installed, then check if webmocking for curl is enabled; if so then proceed to callwebmockr::curl_mock_req
: https://github.com/ropensci/webmockr/blob/adapter-curl/R/curl_mocking.Rexample:
other things:
curl_fetch_disk
I need to work out handling disk operations in a general purpose way for any pacakge adapater (mock writing to disk ropensci/webmockr#57), then can work on mocking forcurl_fetch_disk