diff --git a/DESCRIPTION b/DESCRIPTION index 394693a3..d612e90a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -45,7 +45,6 @@ Suggests: covr, fortunes, miniUI, - mockr, rprojroot, sessioninfo, shiny, diff --git a/inst/WORDLIST b/inst/WORDLIST index 9400458c..8297dc5e 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -67,7 +67,6 @@ lifecycle lockfile macOS metapackage -mockr noninteractive oducible outfiles diff --git a/tests/testthat/helper.R b/tests/testthat/helper.R index e023188a..03e94e46 100644 --- a/tests/testthat/helper.R +++ b/tests/testthat/helper.R @@ -10,10 +10,6 @@ expect_messages_to_include <- function(haystack, needles) { invisible() } -with_mock <- function(..., .parent = parent.frame()) { - mockr::with_mock(..., .parent = .parent, .env = "reprex") -} - # 1. creates a subdirectory within session temp # 2. makes that the current working directory # 3. schedules these cleanup actions for when env goes out of scope: diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index 21362ec3..b7b4ad5a 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -1,23 +1,17 @@ test_that("locate_input() works", { - with_mock( + with_mocked_bindings( reprex_clipboard = function() TRUE, - { - expect_identical("clipboard", locate_input(NULL)) - } + expect_identical("clipboard", locate_input(NULL)) ) - with_mock( + with_mocked_bindings( reprex_clipboard = function() FALSE, in_rstudio = function() TRUE, - { - expect_identical("selection", locate_input(NULL)) - } + expect_identical("selection", locate_input(NULL)) ) - with_mock( + with_mocked_bindings( reprex_clipboard = function() FALSE, in_rstudio = function() FALSE, - { - expect_null(locate_input(NULL)) - } + expect_null(locate_input(NULL)) ) expect_identical("path", locate_input(path_temp())) expect_identical("input", locate_input(c("a", "b")))