Skip to content

Commit f686b2d

Browse files
committed
Update internal uses of deprecated mocking functions
1 parent 8c2bd6e commit f686b2d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

tests/testthat/test-examples.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
test_that("test_examples works with installed packages", {
22
local_edition(2)
33

4-
local_mock(test_rd = identity)
4+
local_mocked_bindings(test_rd = identity)
55
expect_true(length(test_examples()) > 1)
66
})
77

tests/testthat/test-reporter-debug.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
test_that("produces consistent output", {
22
withr::local_options(testthat.edition_ignore = TRUE)
33
local_edition(2)
4-
local_mock(
4+
local_mocked_bindings(
55
show_menu = function(choices, title = NULL) {
66
cat(paste0(format(seq_along(choices)), ": ", choices, sep = "\n"), "\n", sep = "")
77
0L
@@ -22,7 +22,7 @@ get_frame_from_debug_reporter <- function(choice, fun, envir = parent.frame()) {
2222
force(choice)
2323
test_debug_reporter_parent_frame <- NULL
2424

25-
with_mock(
25+
with_mocked_bindings(
2626
show_menu = function(choices, title = NULL) {
2727
# if (choice > 0) print(choices)
2828
my_choice <- choice
@@ -178,4 +178,3 @@ test_that("browser() is called for the correct frame for skips", {
178178
expect_equal(get_vars_from_debug_reporter(3, fun_3), "g")
179179
expect_equal(get_vars_from_debug_reporter(4, fun_3), character())
180180
})
181-

0 commit comments

Comments
 (0)