Skip to content

Commit c7d32bc

Browse files
committed
Update docs
1 parent 674fd8c commit c7d32bc

File tree

3 files changed

+9
-22
lines changed

3 files changed

+9
-22
lines changed

R/mock.R

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
#' Mock functions in a package.
22
#'
33
#' @description
4-
#' `with_mock()` and `local_mock()` are deprecated in favour of
5-
#' [with_mocked_bindings()] and [local_mocked_bindings()].
4+
#' `r lifecycle::badge("defunct")`
65
#'
7-
#' These functions worked by using some C code to temporarily modify the mocked
8-
#' function _in place_. This was an abuse of R's internals and it is no longer
9-
#' permitted.
10-
#'
11-
#' @section 3rd edition:
12-
#' `r lifecycle::badge("deprecated")`
13-
#'
14-
#' `with_mock()` and `local_mock()` are deprecated in the third edition.
6+
#' `with_mock()` and `local_mock()` are now defunct, and can be replaced by
7+
#' [with_mocked_bindings()] and [local_mocked_bindings()]. These functions only
8+
#' worked by abusing of R's internals.
159
#'
1610
#' @param ... named parameters redefine mocked functions, unnamed parameters
1711
#' will be evaluated after mocking the functions
@@ -21,7 +15,6 @@
2115
#' @param .local_envir Environment in which to add exit handler.
2216
#' For expert use only.
2317
#' @keywords internal
24-
#' @return The result of the last unnamed parameter
2518
#' @export
2619
with_mock <- function(..., .env = topenv()) {
2720
lifecycle::deprecate_stop("3.2.0", "with_mock()", "with_mocked_bindings()")

man/expect_match.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/with_mock.Rd

Lines changed: 4 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)