PredictiveEcology / SpaDES-modules

A collection of available modules for use with the 'SpaDES' R package.
12 stars 9 forks source link

added producible test example for moduleCoverage function #4

Closed YongLuo007 closed 8 years ago

YongLuo007 commented 8 years ago

the test was created for forestAge module also please let me know if the downloadModule has the mechanism to download all the tests/testthat/test-forestAgeAge.R.

achubaty commented 8 years ago

Thanks Yong.

Please note that this module is mirrored from our private lab modules repo (sorry if I didn't make that clear). The changes should really be made in that repo. Since this addition is small and simple, I'll incorporate the change there once I've finished updating the modules with the most recent SpaDES changes.

For future reference, please also note:

  1. use tempdir() to create temporary directories for testing

    tmpdir <- tempdir(); on.exit(unlink(tmpdir, recursive = TRUE))
    modulePath <- file.path(tmpdir, "modules")
    outputPath <- file.path(tmpdir, "output")
  2. use downloadModule to download the files to the tempdir

    downloadModule("forestAge", modulePath) # default is not to download data
    downloadData("forestAge", modulePath) # optionally, download data in previous step (`data = TRUE`)
YongLuo007 commented 8 years ago

alex, thanks.

achubaty commented 8 years ago

incorporated and improved in https://github.com/eliotmcintire/McIntire-lab/commit/30e57c39acfbf90042ed5c8114e38a3b5b9a311f