storkit: merge 444_refactor_extract_shared_test_helpers_test_ctx_write_story_file_make_api

This commit is contained in:
dave
2026-03-28 19:47:59 +00:00
parent d216f3c267
commit ddc4a57cd2
27 changed files with 188 additions and 187 deletions
+15
View File
@@ -0,0 +1,15 @@
//! Shared test utilities for chat handler tests.
//!
//! Import with `use crate::chat::test_helpers::write_story_file;`
use std::path::Path;
/// Write a work-item file into the standard pipeline directory structure.
///
/// Creates `.storkit/work/{stage}/{filename}` under `root`, creating any
/// missing parent directories.
pub(crate) fn write_story_file(root: &Path, stage: &str, filename: &str, content: &str) {
let dir = root.join(".storkit/work").join(stage);
std::fs::create_dir_all(&dir).unwrap();
std::fs::write(dir.join(filename), content).unwrap();
}