()
| 550 | |
| 551 | #[test] |
| 552 | fn test_run_without_name() { |
| 553 | let cmd = New::default(); |
| 554 | let result = cmd.run(); |
| 555 | assert!(result.is_err()); |
| 556 | match result.unwrap_err() { |
| 557 | CliError::InvalidArgument { message } => { |
| 558 | assert!(message.contains("required")); |
| 559 | } |
| 560 | other => panic!("Expected InvalidArgument, got: {:?}", other), |
| 561 | } |
| 562 | } |
| 563 | |
| 564 | #[test] |
| 565 | fn test_run_with_invalid_name() { |