-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upkeep:
generate_package_table
gains some simple unit tests (#21)
- Loading branch information
Showing
2 changed files
with
20 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Package: pacta.sit.rep | ||
Title: What the Package Does (One Line, Title Case) | ||
Version: 0.0.0.9001 | ||
Version: 0.0.0.9002 | ||
Authors@R: | ||
person("Jackson", "Hoffart", , "[email protected]", role = c("aut", "cre"), | ||
comment = c(ORCID = "0000-0002-8600-5042")) | ||
|
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,3 +1,20 @@ | ||
test_that("multiplication works", { | ||
expect_equal(2 * 2, 4) | ||
library(testthat) | ||
library(dplyr) | ||
|
||
pacta_r_package_path <- "https://github.com/RMI-PACTA/pacta.r.package" | ||
|
||
test_that("returns correct structure and data", { | ||
result <- generate_package_table(pacta_r_package_path) | ||
expected_names <- c("Repo", "Lifecycle", "Status", "Latest_SHA", "Maintainer") | ||
|
||
expect_true(tibble::is_tibble(result)) | ||
expect_equal(ncol(result), 5) | ||
expect_true(all(expected_names %in% names(result))) | ||
}) | ||
|
||
test_that("handles empty input", { | ||
empty_input <- character(0) | ||
result <- generate_package_table(empty_input) | ||
|
||
expect_true(tibble::is_tibble(result) && nrow(result) == 0) | ||
}) |