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