Easiest way to simulate no free disk space situation?

后端 未结 13 755
执笔经年
执笔经年 2021-02-03 20:11

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

13条回答
  •  温柔的废话
    2021-02-03 20:57

    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?

提交回复
热议问题