Skip to content

Commit

Permalink
writeLines() is better
Browse files Browse the repository at this point in the history
  • Loading branch information
jennybc committed Feb 13, 2024
1 parent 1239300 commit a87a40a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
37 changes: 20 additions & 17 deletions tests/testthat/_snaps/upkeep.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,25 @@
---

Code
print(checklist)
writeLines(checklist)
Output
[1] "* [ ] `usethis::use_readme_rmd()`"
[2] "* [ ] `usethis::use_github_links()`"
[3] "* [ ] `usethis::use_pkgdown_github_pages()`"
[4] "* [ ] `usethis::use_tidy_description()`"
[5] "* [ ] `usethis::use_package_doc()`\nConsider letting usethis manage your `@importFrom` directives here. `usethis::use_import_from()` is handy for this."
[6] "* [ ] `usethis::use_testthat(3)` and upgrade to 3e, [testthat 3e vignette](https://testthat.r-lib.org/articles/third-edition.html)"
[7] "* [ ] Align the names of `R/` files and `test/` files for workflow happiness. The docs for `usethis::use_r()` include a helpful script. `usethis::rename_files()` may be be useful."
[8] "* [ ] Consider changing default branch from `master` to `main`"
[9] "* [ ] Remove description of test environments from `cran-comments.md`.\nSee `usethis::use_cran_comments()`."
[10] "* [ ] Add alt-text to pictures, plots, etc; see <https://posit.co/blog/knitr-fig-alt/> for examples"
[11] ""
[12] "Set up or update GitHub Actions. \\\n Updating workflows to the latest version will often fix troublesome actions:"
[13] "* [ ] `usethis::use_github_action('check-standard')`"
[14] "* [ ] `usethis::use_github_action('test-coverage')`"
[15] ""
[16] "<sup>Created on 2023-01-01 with `usethis::use_upkeep_issue()`, using [usethis v1.1.0](https://usethis.r-lib.org)</sup>"
* [ ] `usethis::use_readme_rmd()`
* [ ] `usethis::use_github_links()`
* [ ] `usethis::use_pkgdown_github_pages()`
* [ ] `usethis::use_tidy_description()`
* [ ] `usethis::use_package_doc()`
Consider letting usethis manage your `@importFrom` directives here. `usethis::use_import_from()` is handy for this.
* [ ] `usethis::use_testthat(3)` and upgrade to 3e, [testthat 3e vignette](https://testthat.r-lib.org/articles/third-edition.html)
* [ ] Align the names of `R/` files and `test/` files for workflow happiness. The docs for `usethis::use_r()` include a helpful script. `usethis::rename_files()` may be be useful.
* [ ] Consider changing default branch from `master` to `main`
* [ ] Remove description of test environments from `cran-comments.md`.
See `usethis::use_cran_comments()`.
* [ ] Add alt-text to pictures, plots, etc; see <https://posit.co/blog/knitr-fig-alt/> for examples
Set up or update GitHub Actions. \
Updating workflows to the latest version will often fix troublesome actions:
* [ ] `usethis::use_github_action('check-standard')`
* [ ] `usethis::use_github_action('test-coverage')`
<sup>Created on 2023-01-01 with `usethis::use_upkeep_issue()`, using [usethis v1.1.0](https://usethis.r-lib.org)</sup>

5 changes: 4 additions & 1 deletion tests/testthat/test-upkeep.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ test_that("upkeep bullets don't change accidentally",{
desc::desc_del("Suggests")
use_package("testthat", "Suggests")

# previously (withr 2.5.0) we could put local_edition(2L) inside {..} inside
# the expect_snapshot() call
# that is no longer true with withr 3.0.0, but this hacktastic approach works
local({
local_edition(2L)
checklist <<- upkeep_checklist()
})

expect_snapshot(print(checklist))
expect_snapshot(writeLines(checklist))
})

test_that("get extra upkeep bullets works", {
Expand Down

0 comments on commit a87a40a

Please sign in to comment.