16 lines
577 B
Rust
16 lines
577 B
Rust
|
|
//! 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();
|
||
|
|
}
|