2026-03-28 19:47:59 +00:00
|
|
|
//! 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.
|
|
|
|
|
///
|
2026-04-03 16:12:52 +01:00
|
|
|
/// Creates `.huskies/work/{stage}/{filename}` under `root`, creating any
|
2026-03-28 19:47:59 +00:00
|
|
|
/// missing parent directories.
|
|
|
|
|
pub(crate) fn write_story_file(root: &Path, stage: &str, filename: &str, content: &str) {
|
2026-04-03 16:12:52 +01:00
|
|
|
let dir = root.join(".huskies/work").join(stage);
|
2026-03-28 19:47:59 +00:00
|
|
|
std::fs::create_dir_all(&dir).unwrap();
|
|
|
|
|
std::fs::write(dir.join(filename), content).unwrap();
|
|
|
|
|
}
|