diff --git a/tests/testthat/test-commented_code_linter.R b/tests/testthat/test-commented_code_linter.R index 6728b7bbd..5154a5a94 100644 --- a/tests/testthat/test-commented_code_linter.R +++ b/tests/testthat/test-commented_code_linter.R @@ -104,20 +104,12 @@ test_that("commented_code_linter can detect operators in comments and lint corre ) }) -test_that("commented_code_linter can detect commented code ending with a base pipe", { - skip_if_not_r_version("4.1.0") +test_that("commented_code_linter can detect commented code ending with pipes", { + linter <- commented_code_linter() + lint_msg <- rex::rex("Remove commented code.") - expect_lint( - "# f() |>", - rex::rex("Remove commented code."), - commented_code_linter() - ) -}) + expect_lint("# f() %>%", lint_msg, linter) -test_that("commented_code_linter can detect commented code ending with a {magrittr} pipe", { - expect_lint( - "# f() %>%", - rex::rex("Remove commented code."), - commented_code_linter() - ) + skip_if_not_r_version("4.1.0") + expect_lint("# f() |>", lint_msg, linter) })