Closed maelle closed 6 years ago
Swapping out httr is a fairly large task - aside of making it a bit easier to test, are there other benefits?
No, well crul
e.g. supports asynchronous requests but I think httr
does now?
In any case, this wouldn't be something for the very next release I think.
okie dokie :)
First experiments with my I16 branch
library(crul)
library(testthat)
# make a stub
webmockr::enable()
stub <- webmockr::stub_request("get", "https://haveibeenpwned.com/api/breaches")
webmockr::to_return(stub, status = 404)
webmockr::stub_registry()
HIBPwned::breached_sites()
webmockr::disable()
head(HIBPwned::breached_sites())
will skip_on_cran()
because these tests take a little while
For that, use
webmockr
.If I do that soon, I'll also need to replace
httr
withcrul
https://github.com/ropensci/webmockrOr I could use the testing package which works with
httr
but I'm less enclined to do so. 🤔