nealrichardson / httptest

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

Problem with with_mock_dir()/gsub_request() #69

Closed maelle closed 2 years ago

maelle commented 2 years ago

:wave: here!

I'm trying to apply https://enpiar.com/r/httptest/index.html#how-do-i-fix-non-portable-file-paths

I've made a minimal example to show what does not work: https://github.com/maelle/teeest

However the fixture still lives in a series of subfolders that ignore the call to httptest::set_requester().

I've set a browser() in that call when running the test interactively to check how the request was amended. It is amended correctly! So something else is going wrong further down the line at the stage of creating the files? I'm a bit lost. :sweat_smile:

maelle commented 2 years ago

What's more, the second time the test is run, it fails because it looks for the fixture where it should be (which is not where it is).

maelle commented 2 years ago

I think capture_requests() does not look for a requester?

maelle commented 2 years ago

I found a fix :tada: (well, it works for me :grin: )