extern crate chrono; extern crate tempfile; extern crate uuid; use uuid::Uuid; use std::{env, fs}; #[test] fn test_build() { let uuid = Uuid::new_v4().to_string(); let temp_dir = tempfile::tempdir().unwrap(); let project_dir = temp_dir.path().join(&uuid); fs::create_dir(&project_dir).unwrap(); fs::create_dir(&project_dir.join("assets")).unwrap(); fs::create_dir(&project_dir.join("drafts")).unwrap(); fs::create_dir(&project_dir.join("pages")).unwrap(); fs::create_dir(&project_dir.join("posts")).unwrap(); fs::create_dir(&project_dir.join("public")).unwrap(); fs::create_dir(&project_dir.join("public").join("posts")).unwrap(); fs::create_dir(&project_dir.join("templates")).unwrap(); fs::write( project_dir.join("assets").join("style.css"), "body { background: blue; }", ) .unwrap(); fs::write( project_dir.join("templates").join("layout.html"), "
This is the first post
It has multiple paragra\ phs
This is the first page
It has multiple paragra\ phs
This is the first post
This is the first page
This is the first draft