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

Function test_init_fails_if_repository_exists

atomic-cli/src/commands/init.rs:934–957  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

932
933 #[test]
934 fn test_init_fails_if_repository_exists() {
935 let temp = TempDir::new().unwrap();
936
937 // First init should succeed
938 let init1 = Init::at_path(temp.path());
939 let result1 = init1.run();
940 if let Err(ref e) = result1 {
941 eprintln!("First init failed: {:?}", e);
942 }
943 assert!(
944 result1.is_ok(),
945 "First init should succeed: {:?}",
946 result1.err()
947 );
948
949 // Second init should fail
950 let init2 = Init::at_path(temp.path());
951 let result = init2.run();
952 assert!(result.is_err());
953 assert!(matches!(
954 result.unwrap_err(),
955 CliError::RepositoryExists { .. }
956 ));
957 }
958
959 #[test]
960 fn test_init_with_custom_view() {

Callers

nothing calls this directly

Calls 3

unwrapMethod · 0.45
pathMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected