nealrichardson / httptest

A Test Environment for HTTP Requests in R
https://enpiar.com/r/httptest/
Other
79 stars 10 forks source link

httptest fails with dev httr #21

Closed hadley closed 5 years ago

hadley commented 5 years ago
library(httr)
library(httptest)
#> Loading required package: testthat

with_fake_http(GET("http://example.com"))
#> GET http://example.com
#> Error in rawToChar(raw): argument 'x' must be a raw vector

Created on 2018-12-06 by the reprex package (v0.2.1)

I think this is because you're assuming a particularly formulation of the internals of httr that is no longer true. Can you please confirm/reproduce ASAP? (This is blocking the httr release)

nealrichardson commented 5 years ago

Thanks. I believe https://github.com/nealrichardson/httptest/commit/c0e35ec5477e66c24eb825077e421599de25e6c7 addresses the issue--httptest's test suite failed hard with that rawToChar error before and now it passes cleanly. The example above also succeeds:

> library(httr)
> library(httptest)
Loading required package: testthat
> #> Loading required package: testthat
> 
> with_fake_http(GET("http://example.com"))
GET http://example.com
Response [http://example.com]
  Date: 2018-12-06 09:18
  Status: 200
  Content-Type: <unknown>
  Size: 4 B
<BINARY BODY>

Before I submit a CRAN release with this, can you confirm that this resolves all of the blocking issues you're seeing? I'm running httptest's revdep checks now with this change and the dev httr branch; if that passes, we're good?

nealrichardson commented 5 years ago

httptest revdep checks with dev httr did pass cleanly, and that should be the same at the revdep checks you ran that failed before, so I think we're in the clear. I'll try to get a CRAN release up later today.

hadley commented 5 years ago

Perfect, thanks!

nealrichardson commented 5 years ago

Submitted to CRAN and accepted.

Dear maintainer,

thanks, package httptest_3.2.2.tar.gz is on its way to CRAN.