From 719f9f14413e2b249b6137621e10a79a74a9f3a5 Mon Sep 17 00:00:00 2001 From: Adrian Malacoda Date: Sun, 5 Aug 2018 00:09:06 -0500 Subject: [PATCH] add proper test for stringify helper --- src/lib.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index c9a24c3..1302b5d 100644 --- a/src/lib.rs +++ b/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]