Showing 2 of total 2 results (show query)
r-lib
mockery:Mocking Library for R
The two main functionalities of this package are creating mock objects (functions) and selectively intercepting calls to a given function that originate in some other function. It can be used with any testing framework available for R. Mock objects can be injected with either this package's own stub() function or a similar with_mock() facility present in the 'testthat' package.
Maintained by Hadley Wickham. Last updated 1 years ago.
100 stars 11.57 score 504 scripts 5 dependentsnbenn
mockthat:Function Mocking for Unit Testing
With the deprecation of mocking capabilities shipped with 'testthat' as of 'edition 3' it is left to third-party packages to replace this functionality, which in some test-scenarios is essential in order to run unit tests in limited environments (such as no Internet connection). Mocking in this setting means temporarily substituting a function with a stub that acts in some sense like the original function (for example by serving a HTTP response that has been cached as a file). The only exported function 'with_mock()' is modeled after the eponymous 'testthat' function with the intention of providing a drop-in replacement.
Maintained by Nicolas Bennett. Last updated 2 years ago.
15 stars 3.94 score 5 scripts