Closed pkrog closed 4 years ago
Right, I was wondering if there would be an easy way to test such a thing.
Still we could encapsulate calls like R.home()
and file.exists()
into a R5/R6 class global instance (with a default instance) that would be replaced when running the test by simulator classes (one for systems where R share folder is in /usr/lib64
and one for systems where R share folder is in /usr/share
). I don't know if you have other sensible code like this one. If yes then developing such an architecture dedicated for testing would be a benefit.
The mock strategy you suggest sounds interesting but is clearly outside the scope of this pull request! I guess I was just thinking wistfully.
I made some minor changes to your PR, in particular returning rather than enclosing the remaining code in an if / else
block to avoid excessive nesting (and also perhaps clearer legibility for the main execution path).
If you are submitting a pull request to
BiocCheck
please follow the instructions outlined in this presentation. This presentation includes steps for forking, creating a branch for you to work on, and useful related information.Prior to sending the pull request, please verify that
R CMD build
andR CMD check
run without warnings or errors on the latest Bioconductor-devel and complete the following steps:The easiest way to obtain a working environment with Bioconductor-devel in your computer is to use the Bioconductor devel docker image as described in detail in the Bioconductor website.
For more questions, please get in touch with the Bioconductor core team through the Bioconductor Slack workspace.