Skip to content

Commit

Permalink
change output key name
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexAxthelm committed Mar 26, 2024
1 parent 876b4fb commit d94cc6a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions R/get_package_info.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ get_package_info <- function(
#' @return nested list of file details, length 11, with keys:
#' - `package`: The name of the package
#' - `version`: The version of the package
#' - `dev_version`: Is this version a development version (loaded with
#' `pkgload`)?
#' - `loaded_with_pkgload`: Is this package loaded with `pkgload`? (logical).
#' Useful for identifying local development versions
#' - `library`: The path of the library the package is installed in
#' - `library_index`: The index of the library in the `.libPaths()` vector
#' - `repository`: The repository the package was pulled from
Expand Down Expand Up @@ -126,7 +126,7 @@ get_individual_package_info <- function(packagename) {
details_list <- list(
package = pkg_details[["package"]],
version = pkg_details[["version"]],
dev_version = dev_package,
loaded_with_pkgload = dev_package,
library = pkg_details[["library"]],
library_index = pkg_details[["library_index"]],
repository = pkg_details[["repository"]],
Expand Down
4 changes: 2 additions & 2 deletions man/get_individual_package_info.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions tests/testthat/test-get_individual_package_info.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ expect_package_info <- function(
remotepkgref_match,
remoteref_identical,
remotesha_identical,
dev_version_identical = FALSE
loaded_with_pkgload_identical = FALSE
) {
testthat::expect_type(package_info, "list")
testthat::expect_named(
package_info,
expected = c(
"package",
"version",
"dev_version",
"loaded_with_pkgload",
"library",
"library_index",
"repository",
Expand All @@ -51,11 +51,11 @@ expect_package_info <- function(
expected = version_identical
)
testthat::expect_identical(
object = package_info[["dev_version"]],
expected = dev_version_identical
object = package_info[["loaded_with_pkgload"]],
expected = loaded_with_pkgload_identical
)

if (dev_version_identical) {
if (loaded_with_pkgload_identical) {
testthat::expect_identical(
object = package_info[["library"]],
expected = NA_character_
Expand Down Expand Up @@ -253,7 +253,7 @@ test_that("get_individual_package_info collects information for packages loaded
package_info,
package_identical = "rmini",
version_identical = "DEV 0.0.4",
dev_version_identical = TRUE,
loaded_with_pkgload_identical = TRUE,
repository_match = NA_character_,
remotetype_identical = "pkgload",
remotepkgref_match = paste0("^", dest_dir, "$"),
Expand Down Expand Up @@ -290,7 +290,7 @@ test_that("get_individual_package_info collects information for packages loaded
package_info,
package_identical = "rmini",
version_identical = "DEV 0.0.4",
dev_version_identical = TRUE,
loaded_with_pkgload_identical = TRUE,
repository_match = NA_character_,
remotetype_identical = "pkgload",
remotepkgref_match = paste0("^", dest_dir, "$"),
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-get_package_info.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ test_that("get_package_info outputs correct structure for defaults", {
names(x) == c(
"package",
"version",
"dev_version",
"loaded_with_pkgload",
"library",
"library_index",
"repository",
Expand Down

0 comments on commit d94cc6a

Please sign in to comment.