From 83a6b5fedbfbb88a40b1b7b6b2e550d62f81b0d8 Mon Sep 17 00:00:00 2001 From: Jenny Bryan Date: Tue, 25 Jun 2024 18:49:36 -0700 Subject: [PATCH] Add a test Relates to #2007 --- tests/testthat/_snaps/tibble.md | 2 +- tests/testthat/test-tibble.R | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/testthat/_snaps/tibble.md b/tests/testthat/_snaps/tibble.md index de3efaf45..f0c3151c5 100644 --- a/tests/testthat/_snaps/tibble.md +++ b/tests/testthat/_snaps/tibble.md @@ -1,4 +1,4 @@ -# use_tibble() Imports tibble +# use_tibble() Imports tibble and imports tibble::tibble() Code use_tibble() diff --git a/tests/testthat/test-tibble.R b/tests/testthat/test-tibble.R index f76efbc22..bcefc4265 100644 --- a/tests/testthat/test-tibble.R +++ b/tests/testthat/test-tibble.R @@ -3,7 +3,7 @@ test_that("use_tibble() requires a package", { expect_usethis_error(use_tibble(), "not an R package") }) -test_that("use_tibble() Imports tibble", { +test_that("use_tibble() Imports tibble and imports tibble::tibble()", { create_local_package() withr::local_options(list(usethis.quiet = FALSE)) @@ -18,4 +18,7 @@ test_that("use_tibble() Imports tibble", { ) expect_match(proj_desc()$get("Imports"), "tibble") + + pkg_doc <- readLines(package_doc_path()) + expect_match(pkg_doc, "#' @importFrom tibble tibble", all = FALSE) })