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();
|
||||
register(&mut handlebars);
|
||||
|
||||
println!("{:?}", handlebars.render_template("{{JSONstringify foo}}", &json!({
|
||||
"foo": {
|
||||
"bar": 1,
|
||||
"baz": 2
|
||||
}
|
||||
})).unwrap());
|
||||
let foo = json!({
|
||||
"bar": 1,
|
||||
"baz": 2
|
||||
});
|
||||
assert_eq!(
|
||||
handlebars.render_template("{{JSONstringify foo}}", &json!({
|
||||
"foo": foo
|
||||
})).unwrap(),
|
||||
foo.to_string()
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Loading…
x
Reference in New Issue
Block a user