RF: use @with_tempfile to generate temporary directory