INNER CODE UNIT · Rust
json_schema
stjude-rust-labs/sprocket · crates/sprocket-test-types/src/lib.rs:308
fn json_schema() -> String {
std::fs::read_to_string(json_schema_path()).unwrap()
}
fn full_test_path() -> PathBuf {
Path::new(env!("CARGO_MANIFEST_DIR"))
.join("assets")
.join("full-test.yaml")
}
#[test]
fn public_schema_up_to_date() {
let current_schema = schema_for!(DocumentTests);
let current_schema_pretty = serde_json::to_string_pretty(¤t_schema).unwrap();
pretty_assertions::assert_eq!(
current_schema_pretty,
json_schema().trim(),