add proper test for stringify helper
This commit is contained in:
parent
5f89f143d1
commit
719f9f1441
16
src/lib.rs
16
src/lib.rs
@ -28,12 +28,16 @@ mod tests {
|
|||||||
let mut handlebars = Handlebars::new();
|
let mut handlebars = Handlebars::new();
|
||||||
register(&mut handlebars);
|
register(&mut handlebars);
|
||||||
|
|
||||||
println!("{:?}", handlebars.render_template("{{JSONstringify foo}}", &json!({
|
let foo = json!({
|
||||||
"foo": {
|
"bar": 1,
|
||||||
"bar": 1,
|
"baz": 2
|
||||||
"baz": 2
|
});
|
||||||
}
|
assert_eq!(
|
||||||
})).unwrap());
|
handlebars.render_template("{{JSONstringify foo}}", &json!({
|
||||||
|
"foo": foo
|
||||||
|
})).unwrap(),
|
||||||
|
foo.to_string()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user