Skip to content

Commit

Permalink
Remove S4 class after test (#1566)
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr authored Jan 3, 2024
1 parent 1382f7d commit 2b7955a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/testthat/test-rd-describe-in.R
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,11 @@ test_that("infix and replacement names get nice label", {
})

test_that("s4 methods get nice label", {
withr::defer(removeClass("foo1"))
out <- roc_proc_text(rd_roclet(), "
#' Class
#'
setClass('foo1', slots = c(id = 'character'))
setClass('foo1', slots = c(id = 'character'), where = .GlobalEnv)
#' @describeIn foo1 generic
setGeneric('m_id', function(x) standardGeneric('m_id'))
Expand All @@ -214,9 +215,11 @@ test_that("s4 methods get nice label", {
")[[1]]
expect_snapshot(out$get_section("minidesc"))

withr::defer(removeClass("foo2"))
withr::defer(removeClass("foo3"))
out <- roc_proc_text(rd_roclet(), "
setClass('foo2')
setClass('foo3')
setClass('foo2', where = .GlobalEnv)
setClass('foo3', where = .GlobalEnv)
#' bar1
setGeneric('bar1', function(x, y) standardGeneric('bar1'))
Expand Down

0 comments on commit 2b7955a

Please sign in to comment.