mock the FileWriter close to store the contents in the
desired_file_content; so it can be read afterwards