Added fs.write() spy to fix tests