()
| 651 | #[test] |
| 652 | #[serial] |
| 653 | fn test_run_with_switch() { |
| 654 | use tempfile::tempdir; |
| 655 | |
| 656 | let _guard = DirGuard::new(); |
| 657 | let temp = tempdir().unwrap(); |
| 658 | let repo_path = temp.path(); |
| 659 | |
| 660 | // Initialize a repository and drop to release lock |
| 661 | { |
| 662 | let _repo = Repository::init(repo_path).unwrap(); |
| 663 | } |
| 664 | |
| 665 | // Change to the repo directory |
| 666 | std::env::set_current_dir(repo_path).unwrap(); |
| 667 | |
| 668 | let cmd = New::with_name("feature-switch").with_switch(true); |
| 669 | let result = cmd.run(); |
| 670 | assert!(result.is_ok()); |
| 671 | |
| 672 | // Verify we switched to the new view |
| 673 | let repo = Repository::open(repo_path).unwrap(); |
| 674 | assert_eq!(repo.current_view(), "feature-switch"); |
| 675 | } |
| 676 | |
| 677 | #[test] |
| 678 | #[serial] |
nothing calls this directly
no test coverage detected