From 23e2cb1169b086bc5f98a6c12ba05f589d63c7ee Mon Sep 17 00:00:00 2001 From: kbvernon Date: Sat, 7 Sep 2024 13:18:38 -0600 Subject: [PATCH] add snapshot test --- tests/testthat/test-use_msrv.R | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/testthat/test-use_msrv.R diff --git a/tests/testthat/test-use_msrv.R b/tests/testthat/test-use_msrv.R new file mode 100644 index 00000000..655290de --- /dev/null +++ b/tests/testthat/test-use_msrv.R @@ -0,0 +1,13 @@ +test_that("use_msrv() modifies the MSRV in the DESCRIPTION", { + skip_if_not_installed("usethis") + + path <- withr::local_package("testpkg") + + # capture setup messages + withr::local_options(usethis.quiet = FALSE) + + use_extendr(path, quiet = TRUE) + use_msrv("1.70") + + expect_snapshot(cat(readLines("DESCRIPTION"), sep = "\n")) +}) \ No newline at end of file