nealrichardson / httptest

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

with_mock_dir should prefer tests/testthat #57

Closed nealrichardson closed 3 years ago

nealrichardson commented 3 years ago

cc @maelle, any thoughts on this?

maelle commented 3 years ago

why not use testthat::test_path()?

maelle commented 3 years ago

(but in any case I do like the improvement, it'll be useful for debugging I think!)

nealrichardson commented 3 years ago

why not use testthat::test_path()?

It could work, though it's more restrictive. It requires paths to be inside tests/testthat and can error. It wasn't suitable for .mockPaths() for those reasons, but maybe it would be ok in this case?

maelle commented 3 years ago

Ah right, could there be use cases of with_mock_dir() outside of tests? 🤔

nealrichardson commented 3 years ago

I'm not sure, but if we can support both interactive testing and using it outside of tests, IMO it's worth a shot. I'll merge this and we can switch to test_path later if we find a reason to.