By Nathan Donaldson
Tags: Development
I recently came across FakeFS, which sounds like a great idea for helping to test file functions. However, I did pick up on the following off the website:
[…] it means replacing our mkdir call with a call to mkdir_p won’t break our tests. Because, really, it shouldn’t.
Now I understand that in the context of the example given, mkdir and mkdir_p should do the same thing. But mkdir and mkdir_p do perform different operations, and the tests should break if mkdir_p is changed to mkdir. If you change mkdir_p to mkdir and your passing tests don’t fail then your tests aren’t correct.