I think I would create a temporary directory & files and just run your code against that.
That way you don't have to mock the os functions at all. In your example it looks easy enough - just touch some file names. Of course if you need to do more complex things, maybe reading info from the files, you may have to keep a set of test files that you copy into your temp dir before you begin the tests.
In reply to Re: Unit testing OS rich code
by RichardK
in thread Unit testing OS rich code
by Voronich
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |