Skip to content

Commit

Permalink
Use lifecycle instead of tibble
Browse files Browse the repository at this point in the history
waldo previously imported tibble so switch to a package that will always be installed with usethis.
  • Loading branch information
hadley committed Nov 6, 2024
1 parent c63c6e8 commit 8f16595
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/testthat/_snaps/use_import_from.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Code
roxygen_ns_show()
Output
[1] "#' @importFrom tibble deframe" "#' @importFrom tibble enframe"
[3] "#' @importFrom tibble tibble"
[1] "#' @importFrom lifecycle deprecate_stop"
[2] "#' @importFrom lifecycle deprecate_warn"

# use_import_from() generates helpful errors

Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-use_import_from.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
test_that("use_import_from() imports the related package & adds line to package doc", {
create_local_package()
use_package_doc()
use_import_from("tibble", "tibble")
use_import_from("lifecycle", "deprecated")

expect_equal(proj_desc()$get_field("Imports"), "tibble")
expect_equal(roxygen_ns_show(), "#' @importFrom tibble tibble")
expect_equal(proj_desc()$get_field("Imports"), "lifecycle")
expect_equal(roxygen_ns_show(), "#' @importFrom lifecycle deprecated")
})

test_that("use_import_from() adds one line for each function", {
create_local_package()
use_package_doc()
use_import_from("tibble", c("tibble", "enframe", "deframe"))
use_import_from("lifecycle", c("deprecate_warn", "deprecate_stop"))

expect_snapshot(roxygen_ns_show())
})
Expand Down

0 comments on commit 8f16595

Please sign in to comment.