| 563 | |
| 564 | #[test] |
| 565 | fn test_run_with_invalid_name() { |
| 566 | let cmd = New::with_name("invalid/name"); |
| 567 | let result = cmd.run(); |
| 568 | // Should fail with InvalidArgument before even trying to open repo |
| 569 | assert!(result.is_err()); |
| 570 | match result.unwrap_err() { |
| 571 | CliError::InvalidArgument { message } => { |
| 572 | assert!(message.contains("'/'")); |
| 573 | } |
| 574 | CliError::RepositoryNotFound { .. } => { |
| 575 | // Also acceptable - validation passed but no repo |
| 576 | } |
| 577 | other => panic!( |
| 578 | "Expected InvalidArgument or RepositoryNotFound, got: {:?}", |
| 579 | other |
| 580 | ), |
| 581 | } |
| 582 | } |
| 583 | |
| 584 | // ------------------------------------------------------------------------- |
| 585 | // Integration Tests (require temp repository) |