I need to test my web app in a scenario where there’s no disk space remaining, i.e. I cannot write any more files. But I don’t want to fill my hard drive with junk just to make
Can't you use a Mock, and substitute the part of your code which actually writes to disk, with a fake test replacement which will throw the exception(s) you expect to see?