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

Function test_settings_roundtrip

atomic-agent/src/hooks/gemini_cli.rs:1310–1330  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1308
1309 #[test]
1310 fn test_settings_roundtrip() {
1311 let dir = tempfile::tempdir().unwrap();
1312 let hook = make_hook();
1313
1314 // Install hooks
1315 hook.install(dir.path()).unwrap();
1316
1317 // Read back and verify structure
1318 let settings_path = dir.path().join(".gemini").join("settings.json");
1319 let content = std::fs::read_to_string(&settings_path).unwrap();
1320 let parsed: serde_json::Value = serde_json::from_str(&content).unwrap();
1321
1322 // Check that hooks are under PascalCase keys
1323 let hooks = parsed.get("hooks").unwrap();
1324 assert!(hooks.get("SessionStart").is_some());
1325 assert!(hooks.get("SessionEnd").is_some());
1326 assert!(hooks.get("BeforeAgent").is_some());
1327 assert!(hooks.get("AfterAgent").is_some());
1328 assert!(hooks.get("BeforeTool").is_some());
1329 assert!(hooks.get("AfterTool").is_some());
1330 }
1331
1332 #[test]
1333 fn test_settings_preserves_unknown_fields() {

Callers

nothing calls this directly

Calls 5

make_hookFunction · 0.70
getMethod · 0.65
unwrapMethod · 0.45
installMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected