init: archlens — architecture diagram generator
Some checks failed
CI / Check / Test (push) Failing after 1m24s
Some checks failed
CI / Check / Test (push) Failing after 1m24s
Hex arch + DDD, tree-sitter parsing, Mermaid/ASCII output. Supports Rust + Python. 92 tests. CI, diff, --check for staleness detection.
This commit is contained in:
26
crates/application/tests/fakes/output_writer.rs
Normal file
26
crates/application/tests/fakes/output_writer.rs
Normal file
@@ -0,0 +1,26 @@
|
||||
use std::cell::RefCell;
|
||||
|
||||
use archlens_domain::{DomainError, RenderOutput, ports::OutputWriter};
|
||||
|
||||
pub struct FakeOutputWriter {
|
||||
written: RefCell<Vec<RenderOutput>>,
|
||||
}
|
||||
|
||||
impl FakeOutputWriter {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
written: RefCell::new(Vec::new()),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn written_outputs(&self) -> Vec<RenderOutput> {
|
||||
self.written.borrow().clone()
|
||||
}
|
||||
}
|
||||
|
||||
impl OutputWriter for FakeOutputWriter {
|
||||
fn write(&self, output: &RenderOutput) -> Result<(), DomainError> {
|
||||
self.written.borrow_mut().push(output.clone());
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user