r-lib / gh

Minimalistic GitHub API client in R
https://gh.r-lib.org
Other
223 stars 52 forks source link

refactor gh::gh parameter handling to make testable without mocking #202

Closed tanho63 closed 2 months ago

tanho63 commented 2 months ago

Closes #197 as part of tidy dev day

Original issue suggested replacing mockery with testthat::with_mock, however the usage of mockery was to test parameter handling (accepting via both ... and a .params arg) so naive replacement caused an infinitely recursive call to gh_build_request.

Resolved by refactoring parameter handling into its own function, .parse_params(), which is easier to test conventionally