Package: mockthat 0.2.8

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.

Authors:Nicolas Bennett [aut, cre]

mockthat_0.2.8.tar.gz
mockthat_0.2.8.zip(r-4.5)mockthat_0.2.8.zip(r-4.4)mockthat_0.2.8.zip(r-4.3)
mockthat_0.2.8.tgz(r-4.4-any)mockthat_0.2.8.tgz(r-4.3-any)
mockthat_0.2.8.tar.gz(r-4.5-noble)mockthat_0.2.8.tar.gz(r-4.4-noble)
mockthat_0.2.8.tgz(r-4.4-emscripten)mockthat_0.2.8.tgz(r-4.3-emscripten)
mockthat.pdf |mockthat.html
mockthat/json (API)
NEWS

# Install 'mockthat' in R:
install.packages('mockthat', repos = c('https://nbenn.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/nbenn/mockthat/issues

On CRAN:

7 exports 15 stars 3.88 score 1 dependencies 5 scripts 989 downloads

Last updated 2 years agofrom:4a070bfd39. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 23 2024
R-4.5-winOKSep 23 2024
R-4.5-linuxOKSep 23 2024
R-4.4-winOKSep 23 2024
R-4.4-macOKSep 23 2024
R-4.3-winOKSep 23 2024
R-4.3-macOKSep 23 2024

Exports:local_mockmockmock_argmock_argsmock_callmock_n_calledwith_mock

Dependencies:rlang

Readme and manuals

Help Manual

Help pageTopics
Mocking helper functionsmock mock_arg mock_args mock_call mock_n_called
Mock functions in a package.local_mock with_mock