MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_run_with_switch

Function test_run_with_switch

atomic-cli/src/commands/view/new.rs:735–757  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

733 #[test]
734 #[file_serial]
735 fn test_run_with_switch() {
736 use tempfile::tempdir;
737
738 let _guard = DirGuard::new();
739 let temp = tempdir().unwrap();
740 let repo_path = temp.path();
741
742 // Initialize a repository and drop to release lock
743 {
744 let _repo = Repository::init(repo_path).unwrap();
745 }
746
747 // Change to the repo directory
748 std::env::set_current_dir(repo_path).unwrap();
749
750 let cmd = New::with_name("feature-switch").with_switch(true);
751 let result = cmd.run();
752 assert!(result.is_ok());
753
754 // Verify we switched to the new view
755 let repo = Repository::open(repo_path).unwrap();
756 assert_eq!(repo.current_view(), "feature-switch");
757 }
758
759 #[test]
760 #[file_serial]

Callers

nothing calls this directly

Calls 6

openFunction · 0.85
initFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45
with_switchMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected