refactor cleardata to accept file option
Adding test when passing file through options