with_mock()
now requires braces (so that error locations can be reported more accurately) and supports only one expression (#15).local_mock()
(#6).with_mock()
works when running a testthat::test_that()
block interactively (#7).get_mock_env()
to make the mocking environment explicit (#7).Initial CRAN release.
with_mock()
modeled closely after testthat::with_mock()
, can only mock in the package under test but avoids fiddling with R’s internals.
.env
argument now can be a character, but using this argument may lead to different results than testthat::with_mock()
.