| 645 | |
| 646 | #[test] |
| 647 | fn test_run_with_invalid_name() { |
| 648 | let cmd = New::with_name("invalid/name"); |
| 649 | let result = cmd.run(); |
| 650 | // Should fail with InvalidArgument before even trying to open repo |
| 651 | assert!(result.is_err()); |
| 652 | match result.unwrap_err() { |
| 653 | CliError::InvalidArgument { message } => { |
| 654 | assert!(message.contains("'/'")); |
| 655 | } |
| 656 | CliError::RepositoryNotFound { .. } => { |
| 657 | // Also acceptable - validation passed but no repo |
| 658 | } |
| 659 | other => panic!( |
| 660 | "Expected InvalidArgument or RepositoryNotFound, got: {:?}", |
| 661 | other |
| 662 | ), |
| 663 | } |
| 664 | } |
| 665 | |
| 666 | // ------------------------------------------------------------------------- |
| 667 | // Integration Tests (require temp repository) |