#![allow(
clippy::missing_docs_in_private_items,
reason = "test helpers and fixtures do not need doc comments"
)]
use super::MoadimMcp;
fn make_handler() -> MoadimMcp {
MoadimMcp::new(
crate::routines::new_store(),
crate::paths::routines_dir(),
0,
std::sync::Arc::new(tokio::sync::Notify::new()),
)
}
#[test]
fn cleanup_workbenches_tool_returns_removed_count() {
let handler = make_handler();
let result = handler.cleanup_workbenches().unwrap();
assert!(!result.is_error.unwrap_or(false));
let json_str = match &result.content[0] {
rmcp::model::ContentBlock::Text(block) => block.text.clone(),
_ => panic!("expected text content"),
};
let val: serde_json::Value = serde_json::from_str(&json_str).unwrap();
assert!(val["removed"].is_u64());
assert!(val["freed_bytes"].is_u64());
}