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:

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

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

TargetResultDate
Doc / VignettesOKNov 22 2024
R-4.5-winOKNov 22 2024
R-4.5-linuxOKNov 22 2024
R-4.4-winOKNov 22 2024
R-4.4-macOKNov 22 2024
R-4.3-winOKNov 22 2024
R-4.3-macOKNov 22 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