diff --git a/DESCRIPTION b/DESCRIPTION index a85039c..fbcc8bb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -24,12 +24,11 @@ URL: https://evaluate.r-lib.org/, https://github.com/r-lib/evaluate BugReports: https://github.com/r-lib/evaluate/issues Depends: R (>= 4.0.0) -Imports: - methods Suggests: covr, ggplot2, lattice, + methods, rlang, testthat (>= 3.0.0), withr diff --git a/tests/testthat/test-evaluate.R b/tests/testthat/test-evaluate.R index e607d74..7b1aa2b 100644 --- a/tests/testthat/test-evaluate.R +++ b/tests/testthat/test-evaluate.R @@ -25,18 +25,18 @@ test_that("terminal newline not needed", { }) test_that("S4 methods are displayed with show, not print", { - setClass("A", contains = "function", where = environment()) - setMethod("show", "A", function(object) cat("B")) - a <- new('A', function() b) + methods::setClass("A", contains = "function", where = environment()) + methods::setMethod("show", "A", function(object) cat("B")) + a <- methods::new('A', function() b) ev <- evaluate("a") expect_equal(ev[[2]], "B") }) test_that("errors during printing visible values are captured", { - setClass("A", contains = "function", where = environment()) - setMethod("show", "A", function(object) stop("B")) - a <- new('A', function() b) + methods::setClass("A", contains = "function", where = environment()) + methods::setMethod("show", "A", function(object) stop("B")) + a <- methods::new('A', function() b) ev <- evaluate("a") expect_s3_class(ev[[2]], "error")