Skip to content

Commit

Permalink
use glue for pastes
Browse files Browse the repository at this point in the history
  • Loading branch information
maxheld83 committed Sep 12, 2024
1 parent f90d2ab commit 29850a5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Imports:
checkmate,
cli,
fs,
glue,
options,
pkgload,
purrr,
Expand Down
8 changes: 3 additions & 5 deletions R/installed.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ check_pkg_installed <- function(x = character(1L)) {
if (rlang::is_installed(x)) {
return(TRUE)
} else {
paste("Package", x, "is not installed.")
glue::glue("Package {x} is not installed")
}
}

Expand Down Expand Up @@ -78,10 +78,8 @@ check_pkg_installed_but_not_via_loadall <- function(x = character(1L)) {
return(res)
}
if (pkgload::is_dev_package(x)) {
paste(
"The version of package",
x,
"was loaded from `pkgload::load_all()`.",
glue::glue(
"The version of package {x} was loaded from `pkgload::load_all()`.",
"It is not the installed version."
)
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-installed.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe("check_pkg_installed", {
"returns message for non-installed packages",
expect_equal(
check_pkg_installed("doNOTexist"),
"Package doNOTexist is not installed."
"Package doNOTexist is not installed"
)

)
Expand Down

0 comments on commit 29850a5

Please sign in to comment.