-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Also update favicons * Start with a PR * Bumping version is now in upkeep * Use mocking more consistently in tests
- Loading branch information
Showing
6 changed files
with
57 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,49 @@ | ||
test_that("tidy upkeep bullets don't change accidentally", { | ||
withr::local_options( | ||
usethis.description = list( | ||
"Authors@R" = utils::person( | ||
"Jane", "Doe", | ||
email = "[email protected]", | ||
role = c("aut", "cre") | ||
), | ||
License = "MIT + file LICENSE" | ||
) | ||
) | ||
create_local_package() | ||
use_mit_license() | ||
|
||
expect_snapshot( | ||
writeLines(tidy_upkeep_checklist(posit_pkg = TRUE, posit_person_ok = FALSE)), | ||
transform = scrub_checklist_footer | ||
local_mocked_bindings( | ||
Sys.Date = function() as.Date("2023-01-01"), | ||
usethis_version = function() "1.1.0", | ||
author_has_rstudio_email = function() TRUE, | ||
is_posit_pkg = function() TRUE, | ||
is_posit_person_canonical = function() FALSE | ||
) | ||
|
||
expect_snapshot(writeLines(tidy_upkeep_checklist())) | ||
}) | ||
|
||
test_that("upkeep bullets don't change accidentally",{ | ||
skip_if_no_git_user() | ||
withr::local_options(usethis.description = NULL) | ||
|
||
create_local_package() | ||
local_mocked_bindings(git_default_branch = function() "main") | ||
use_cran_comments() | ||
|
||
expect_snapshot( | ||
writeLines(upkeep_checklist()), | ||
transform = scrub_checklist_footer | ||
local_mocked_bindings( | ||
Sys.Date = function() as.Date("2023-01-01"), | ||
usethis_version = function() "1.1.0", | ||
git_default_branch = function() "main" | ||
) | ||
|
||
expect_snapshot(writeLines(upkeep_checklist())) | ||
|
||
# Add some files to test conditional todos | ||
use_code_of_conduct("[email protected]") | ||
use_testthat() | ||
withr::local_file("cran-comments.md") | ||
writeLines( | ||
"## Test environments\\n\\n* local Ubuntu\\n\\# R CMD check results\\n", | ||
"cran-comments.md" | ||
) | ||
writeLines("# test environment\n", "cran-comments.md") | ||
local_mocked_bindings(git_default_branch = function() "master") | ||
|
||
expect_snapshot({ | ||
local_edition(2L) | ||
writeLines(upkeep_checklist()) | ||
}, | ||
transform = scrub_checklist_footer | ||
) | ||
}) | ||
}) | ||
|
||
test_that("get extra upkeep bullets works", { | ||
env <- env(upkeep_bullets = function() c("extra", "upkeep bullets")) | ||
expect_equal(upkeep_extra_bullets(env), | ||
c("* [ ] extra", "* [ ] upkeep bullets", "")) | ||
expect_equal( | ||
upkeep_extra_bullets(env), | ||
c("* [ ] extra", "* [ ] upkeep bullets", "") | ||
) | ||
|
||
env <- NULL | ||
expect_equal(upkeep_extra_bullets(env), "") | ||
|