Fix conditional compilation for contrib templates tests.

This commit is contained in:
Sergio Benitez 2018-06-03 20:36:10 +02:00
parent 1e8e4cc553
commit 397a646dcf
1 changed files with 59 additions and 57 deletions

View File

@ -1,6 +1,8 @@
extern crate rocket; extern crate rocket;
extern crate rocket_contrib; extern crate rocket_contrib;
#[cfg(feature = "templates")]
mod templates_tests {
use std::env; use std::env;
use std::path::PathBuf; use std::path::PathBuf;
@ -18,7 +20,7 @@ fn rocket() -> Rocket {
.extra("template_dir", template_root().to_str().expect("template directory")) .extra("template_dir", template_root().to_str().expect("template directory"))
.expect("valid configuration"); .expect("valid configuration");
rocket::custom(config, true).attach(Template::fairing()) ::rocket::custom(config, true).attach(Template::fairing())
} }
#[cfg(feature = "tera_templates")] #[cfg(feature = "tera_templates")]
@ -68,4 +70,4 @@ mod handlebars_tests {
assert_eq!(template, Some(EXPECTED.into())); assert_eq!(template, Some(EXPECTED.into()));
} }
} }
}