Skip to content

Commit

Permalink
Return the package path in createCompDbPackage (issue #19)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorainer committed Nov 8, 2017
1 parent dbcd9cf commit 0828b30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/createCompDbPackage.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions tests/testthat/test_createCompDbPackage.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,9 @@ test_that("createCompDb and createCompDbPackage works", {
## createCompDbPackage:
res <- createCompDbPackage(db_f, version = "0.0.1",
maintainer = "John Doe <john.doe@mail.com>",
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")
Expand Down

0 comments on commit 0828b30

Please sign in to comment.