should specifically check if it is a file

I make a directory with the same name as previous test which caused it
not to be pruned from the database.