Uses temp directory for tests