Skip to content

Commit bb35a0f

Browse files
committed
Add tests for deprecated functions
1 parent c34f1f2 commit bb35a0f

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ Suggests:
5151
rmarkdown,
5252
stringi,
5353
testthat (>= 3.0.0),
54-
tibble
54+
tibble,
55+
withr
5556
VignetteBuilder: knitr
5657
Config/testthat/edition: 3
5758
Encoding: UTF-8

tests/testthat/test-deprecated.R

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
test_that("get_schema() shows deprecation warning", {
2+
p <- example_package()
3+
lifecycle::expect_deprecated(get_schema(p, "deployments"))
4+
})
5+
6+
test_that("get_schema() forwards to schema()", {
7+
withr::local_options(lifecycle_verbosity = "quiet")
8+
p <- example_package()
9+
expect_identical(
10+
get_schema(p, "deployments"),
11+
schema(p, "deployments")
12+
)
13+
})
14+
15+
test_that("resources() shows deprecation warning", {
16+
p <- example_package()
17+
lifecycle::expect_deprecated(resources(p))
18+
})
19+
20+
test_that("resources() forwards to resource_names()", {
21+
withr::local_options(lifecycle_verbosity = "quiet")
22+
p <- example_package()
23+
expect_identical(
24+
resources(p),
25+
resource_names(p)
26+
)
27+
})

0 commit comments

Comments
 (0)