MCPcopy Create free account
hub / github.com/aiscriptdev/aiscript / test_project_already_exists

Function test_project_already_exists

aiscript/src/project.rs:194–223  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

192
193 #[test]
194 fn test_project_already_exists() {
195 // Use tempdir to ensure test files are cleaned up
196 let temp_dir = tempdir().unwrap();
197 let temp_path = temp_dir.path();
198
199 // Create a directory that will conflict
200 let project_name = "existing_project";
201 let project_path = temp_path.join(project_name);
202 fs::create_dir_all(&project_path).unwrap();
203
204 // Create a generator with absolute path
205 let generator = ProjectGenerator {
206 project_name: project_name.to_string(),
207 project_path,
208 };
209
210 let result = generator.generate();
211
212 assert!(
213 result.is_err(),
214 "Project generation should fail for existing directory"
215 );
216 if let Err(err) = result {
217 assert!(
218 err.contains("already exists"),
219 "Wrong error message: {}",
220 err
221 );
222 }
223 }
224}

Callers

nothing calls this directly

Calls 1

generateMethod · 0.45

Tested by

no test coverage detected