I am writing some objects that make extensive use of the file system. I am not sure if this is the right way to test them.
I know theoretically, I have to abstract the functionality of the file system in some objects and then mock them, but in my case it would be completely pointless: the main use of the classes that I want to test is to manage files. Therefore, I would have the same problem when testing new objects that are just shifted one level.
The only way I can do the tests is to actually work with the file system. The problem is that the tests will run both in the browser and on the command line, so I need to work in a directory with write access for everyone. Moreover, this is not a very portable solution.
Any ideas?
source
share