diff --git a/R/createCompDbPackage.R b/R/createCompDbPackage.R index a142936..9e8d32d 100644 --- a/R/createCompDbPackage.R +++ b/R/createCompDbPackage.R @@ -611,7 +611,7 @@ createCompDbPackage <- function(x, version, maintainer, author, sqlite_path <- file.path(path, pkg_name, "inst", "extdata") dir.create(sqlite_path, showWarnings = FALSE, recursive = TRUE) file.copy(x, to = file.path(sqlite_path, paste0(pkg_name, ".sqlite"))) - invisible(TRUE) + invisible(file.path(path, pkg_name)) } #' @description Simple test function to evaluate whether a file is an SDF file diff --git a/tests/testthat/test_createCompDbPackage.R b/tests/testthat/test_createCompDbPackage.R index aec7002..c298a04 100644 --- a/tests/testthat/test_createCompDbPackage.R +++ b/tests/testthat/test_createCompDbPackage.R @@ -183,8 +183,9 @@ test_that("createCompDb and createCompDbPackage works", { ## createCompDbPackage: res <- createCompDbPackage(db_f, version = "0.0.1", maintainer = "John Doe ", - author = "J Doe", path = tempdir()) - expect_true(res) + author = "J Doe", path = tempdir()) + expect_true(is.character(res)) + expect_equal(basename(res), "CompDb.Hsapiens.ChEBI.unknown") ## Provide a single file name. fl <- system.file("sdf/LipidMaps_sub.sdf.gz", package = "CompoundDb")