Check if the folder already exists before adding to gitignore.
Fixed test.
Added mockery.