Skip to content

Commit

Permalink
Activate testthat 3e (ropensci#80)
Browse files Browse the repository at this point in the history
* Use `testthat` 3e

* Do not show col types
  • Loading branch information
jrdnbradford authored Sep 25, 2024
1 parent ba2147f commit cd9ad51
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Suggests:
curl,
knitr,
rmarkdown,
testthat,
testthat (>= 3.0.0),
tidyr,
tidytext,
withr
Expand All @@ -45,3 +45,4 @@ LazyData: TRUE
LazyDataCompression: xz
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
Config/testthat/edition: 3
2 changes: 1 addition & 1 deletion R/gutenberg_mirrors.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ gutenberg_get_mirror <- function(verbose = TRUE) {
gutenberg_get_all_mirrors <- function() {
mirrors_url <- "https://www.gutenberg.org/MIRRORS.ALL"
mirrors <- suppressWarnings( # Table has extra row that causes vroom warning
readMDTable::read_md_table(mirrors_url, warn = FALSE) |>
readMDTable::read_md_table(mirrors_url, warn = FALSE, show_col_types = FALSE) |>
dplyr::slice(2:(dplyr::n() - 1))
)

Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ test_that("All four datasets have a date-updated", {
d3 <- attr(gutenberg_authors, "date_updated")
d4 <- attr(gutenberg_languages, "date_updated")

expect_is(d1, "Date")
expect_is(d2, "Date")
expect_is(d3, "Date")
expect_is(d4, "Date")
expect_s3_class(d1, "Date")
expect_s3_class(d2, "Date")
expect_s3_class(d3, "Date")
expect_s3_class(d4, "Date")
})

0 comments on commit cd9ad51

Please sign in to comment.