Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
Relates to #2007
  • Loading branch information
jennybc committed Jun 26, 2024
1 parent e19553e commit 6484448
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/tibble.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# use_tibble() Imports tibble
# use_tibble() Imports tibble and imports tibble::tibble()

Code
use_tibble()
Expand Down
5 changes: 4 additions & 1 deletion tests/testthat/test-tibble.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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)
})

0 comments on commit 6484448

Please sign in to comment.