mockthat: Function Mocking for Unit Testing in R

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.

Version: 0.2.4
Depends: R (≥ 3.3.0)
Imports: utils
Suggests: testthat, curl, jsonlite, datasets, withr
Published: 2020-12-09
Author: Nicolas Bennett [aut, cre]
Maintainer: Nicolas Bennett <nicolas.bennett at>
License: MIT + file LICENSE
NeedsCompilation: no
Language: en-US
Materials: README NEWS
CRAN checks: mockthat results


Reference manual: mockthat.pdf
Package source: mockthat_0.2.4.tar.gz
Windows binaries: r-devel:, r-release:, r-oldrel:
macOS binaries: r-release: mockthat_0.2.4.tgz, r-oldrel: mockthat_0.2.4.tgz


Please use the canonical form to link to this page.