diff --git a/R/directory.R b/R/directory.R index 3fdfdaf..d209ce1 100644 --- a/R/directory.R +++ b/R/directory.R @@ -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)) diff --git a/tests/testthat/test-dirs.R b/tests/testthat/test-dirs.R index 1519fe8..67c884d 100644 --- a/tests/testthat/test-dirs.R +++ b/tests/testthat/test-dirs.R @@ -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) })