extern crate serde_json; #[test] #[cfg(feature = "rust-embed")] fn test_embed() { use rust_embed::RustEmbed; #[derive(RustEmbed)] #[folder = "tests/templates/"] #[include = "*.hbs"] struct Templates; let mut hbs = handbar::Handbar::new(); hbs.register_embed_templates::().unwrap(); assert_eq!(1, hbs.get_templates().len()); let data = json!({ "name": "Andy" }); assert_eq!( hbs.render("hello.hbs", &data).unwrap().trim(), "Hello, Andy" ); }