Skip to content

Commit

Permalink
fix end of directory message testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mghoff committed Oct 30, 2023
1 parent 09f6679 commit 29ee7d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion R/directory.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ eia_dir <- function(dir = NULL, tidy = TRUE, cache = TRUE, key = eia_get_key()){
} else {
message(paste0(
"No further sub-directories to discover.\n",
"Use `eia_metadata(', dir, ')` to explore this data."
"Use `eia_metadata('", dir, "')` to explore this data."
))
}
if(tidy && is.data.frame(r))
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-dirs.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ test_that("directory functions returns as expected", {
expect_s3_class(x, "tbl_df")
expect_equal(dim(x), c(6, 3))

msg <- paste0(
suppressMessages(msg <- message(
"No further sub-directories to discover.\n",
"Use `eia_metadata('electricity/retail-sales')` to explore this data."
)
expect_message(eia_dir("electricity/retail-sales"), msg)
))
expect_message(eia_dir("electricity/retail-sales", cache = F), msg)

})

Expand Down

0 comments on commit 29ee7d2

Please sign in to comment.