Skip to content
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

Problem with with_mock_dir()/gsub_request() #69

Closed
maelle opened this issue Apr 26, 2022 · 3 comments · Fixed by #70
Closed

Problem with with_mock_dir()/gsub_request() #69

maelle opened this issue Apr 26, 2022 · 3 comments · Fixed by #70

Comments

@maelle
Copy link
Contributor

maelle commented Apr 26, 2022

👋 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

  • The tests uses with_mock_dir().
  • I've a inst/httptest/request.R.

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. 😅

@maelle maelle changed the title Problem with with_mock_api()/gsub_request() Problem with with_mock_dir()/gsub_request() Apr 26, 2022
@maelle
Copy link
Contributor Author

maelle commented Apr 26, 2022

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
Copy link
Contributor Author

maelle commented Apr 26, 2022

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

@maelle
Copy link
Contributor Author

maelle commented Apr 26, 2022

I found a fix 🎉 (well, it works for me 😁 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant