baumer-lab / fertile

creating optimal conditions for reproducibility
GNU General Public License v3.0
52 stars 4 forks source link

fixed search path problem (issue #7) #64

Closed ambertin closed 4 years ago

ambertin commented 4 years ago

Forced fertile to the top of the search path when library() or require() is called. This seems to work in my testing and should solve the issue we were having!

This pull request also includes an older update where I changed a NULL error message that was being provided to users to something more informative.

ambertin commented 4 years ago

I've been attempting to work on this for the past half hour and it seems like it may not be possible. Presumably due to the way it creates a new testing environment,testthat does not respond to calls of library() or require() that are within tests. You can only detach packages, not add them. As a result, I am unable to manipulate the search path and check that the function is working correctly. Do you have any suggestions for getting around this?

beanumber commented 4 years ago

No. I'll merge the PR.