Extract the creation of the mock file tree into a helper method

This way, it's easier to use this setup code in multiple before blocks
in a DRY way.