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