test ensure_dir_exists