Why would you use mocks to test those things?
Re:OOP Is Dead, Long Live OOP
by humanrebar on Thursday October 18, 2018 @11:47PM
(#18254112)
Because manually triggering an optimistic locking failure is a pain. Triggering one of those and a filesystem write failure at the same time is a whole pile of work compared to the mocking.
For small programs with few interfaces to worry about, that might be fine, but as you number of users go up, the odds go up that you'll be ensuring rollback bits get flipped when filesystems fail. None of that is simple to test without some sort of dependency injection or other heavyweight design pattern.