-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Enable package installation from GitHub, Bioconductor and local…
… directory.
- Loading branch information
1 parent
b032a3c
commit d0f43ef
Showing
2 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
describe("extract_package_name", { | ||
it("returns the package name intact when using only the package name", { | ||
expect_equal(extract_package_name("shiny"), "shiny") | ||
}) | ||
|
||
it("returns the package name intact when using the package name and version", { | ||
expect_equal(extract_package_name("shiny@1.6.0"), "shiny") | ||
}) | ||
|
||
it("returns the package name when installing a package from GitHub", { | ||
expect_equal(extract_package_name("r-lib/httr"), "httr") | ||
expect_equal(extract_package_name("r-lib/testthat@c67018fa4970"), "testthat") | ||
}) | ||
|
||
it("returns the package name when installing a package from a local path", { | ||
expect_equal(extract_package_name("~/path/to/package"), "package") | ||
}) | ||
|
||
it("returns the package name when installing a package from Bioconductor", { | ||
expect_equal(extract_package_name("bioc::Biobase"), "Biobase") | ||
}) | ||
}) | ||
|
||
describe("extract_packages_names", { | ||
it("returns a vector of package names when installing multiple packages", { | ||
expect_equal(extract_packages_names(c("shiny", "dplyr")), c("shiny", "dplyr")) | ||
}) | ||
}) |