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:921–944  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

919
920 #[test]
921 fn test_init_fails_if_repository_exists() {
922 let temp = TempDir::new().unwrap();
923
924 // First init should succeed
925 let init1 = Init::at_path(temp.path());
926 let result1 = init1.run();
927 if let Err(ref e) = result1 {
928 eprintln!("First init failed: {:?}", e);
929 }
930 assert!(
931 result1.is_ok(),
932 "First init should succeed: {:?}",
933 result1.err()
934 );
935
936 // Second init should fail
937 let init2 = Init::at_path(temp.path());
938 let result = init2.run();
939 assert!(result.is_err());
940 assert!(matches!(
941 result.unwrap_err(),
942 CliError::RepositoryExists { .. }
943 ));
944 }
945
946 #[test]
947 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