Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #509 from Appsilon/fix/installation-from-github
Enable package installation from GitHub, Bioconductor and local directory.
- Loading branch information
Showing
6 changed files
with
146 additions
and
3 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,40 @@ | ||
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")) | ||
}) | ||
}) | ||
|
||
describe("pkg_install", { | ||
it("throws an error when the argument is not a character vector", { | ||
expect_error(pkg_install(1)) | ||
}) | ||
}) | ||
|
||
describe("pkg_remove", { | ||
it("throws an error when the argument is not a character vector", { | ||
expect_error(pkg_remove(1)) | ||
}) | ||
}) |