Skip to main content

replay_at

Function replay_at 

Source
pub fn replay_at(root: &Path) -> Result<ObservatoryReplay, CapabilityError>
Expand description

The recording at RECORDING under root. Absent is present: false; a file that is there and cannot be read or is not a recording is an error, never an empty answer.

use majordomus_cli::capability::builtin::observatory::{replay_at, RECORDING};
let dir = tempfile::tempdir().unwrap();
let path = dir.path().join(RECORDING);
std::fs::create_dir_all(path.parent().unwrap()).unwrap();
std::fs::write(&path, "{}").unwrap();
assert!(replay_at(dir.path()).is_err(), "a file that is not a recording is refused");