> Stubbing methods on File tends to be a bad idea.

If you're doing IO sure (I'd rather DI a StringIO instead) but this kind of stubbing is fine and I'd rather do this than rely on the FS