Improve cli tests, fs.exists should be checked after writing the file
Merge pull request #149 from arian/improve-cli-tests

Improve cli tests, fs.exists should be checked after writing the file.