MUCollective / multiverse

R package for creating explorable multiverse analysis
https://mucollective.github.io/multiverse/
GNU General Public License v3.0
62 stars 5 forks source link

put test dfs in global env, hackishly closes #16 #17

Closed mjskay closed 5 years ago

mjskay commented 5 years ago

testthat doesn't execute code in the global environment, but (I think) code executed by the multiverse looks for its variables in the global environment? (is that right?). This is why your test_dfs aren't found when executed by testthat, but are found if you happened to define them in advance in the global environment.

There's a bigger potential issue here of just what should the parent environment to the multiverse environments be (maybe where the multiverse is first created, if that's possible?). Should to open an issue to keep track of that question.

In the meantime, the hackish solution is to just use <<- to write the test_dfs into the global environment when running tests, and we can revisit later if we decide to change the parent environment for the universe environments.