Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakillo committed Feb 13, 2022
1 parent 3fe6bc3 commit 52243dc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ Imports:
rmarkdown,
utils
Suggests:
rstudioapi,
testthat
rstudioapi,
testthat (>= 3.0.0)
URL: https://pakillo.github.io/grateful
BugReports: https://github.com/Pakillo/grateful/issues
RoxygenNote: 7.1.2
Config/testthat/edition: 3
4 changes: 4 additions & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
library(testthat)
library(grateful)

test_check("grateful")
14 changes: 14 additions & 0 deletions tests/testthat/test-scan_packages.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
test_that("scan_packages return correct output", {

out <- scan_packages(pkgs = c("grateful", "renv", "utils"))

ref <- data.frame(pkg = c("grateful", "renv", "utils"),
version = as.character(
c(utils::packageVersion("grateful"),
utils::packageVersion("renv"),
utils::packageVersion("utils"))),
row.names = NULL)

expect_equal(out, ref)

})

0 comments on commit 52243dc

Please sign in to comment.