|
@@ -13,9 +13,8 @@ fn test_build() {
|
13
|
13
|
let project_dir = temp_dir.path().join(&uuid);
|
14
|
14
|
|
15
|
15
|
fs::create_dir(&project_dir).unwrap();
|
16
|
|
- fs::create_dir(&project_dir.join("css")).unwrap();
|
|
16
|
+ fs::create_dir(&project_dir.join("assets")).unwrap();
|
17
|
17
|
fs::create_dir(&project_dir.join("drafts")).unwrap();
|
18
|
|
- fs::create_dir(&project_dir.join("js")).unwrap();
|
19
|
18
|
fs::create_dir(&project_dir.join("pages")).unwrap();
|
20
|
19
|
fs::create_dir(&project_dir.join("posts")).unwrap();
|
21
|
20
|
fs::create_dir(&project_dir.join("public")).unwrap();
|
|
@@ -23,15 +22,10 @@ fn test_build() {
|
23
|
22
|
fs::create_dir(&project_dir.join("templates")).unwrap();
|
24
|
23
|
|
25
|
24
|
fs::write(
|
26
|
|
- project_dir.join("css").join("style.css"),
|
|
25
|
+ project_dir.join("assets").join("style.css"),
|
27
|
26
|
"body { background: blue; }",
|
28
|
27
|
)
|
29
|
28
|
.unwrap();
|
30
|
|
- fs::write(
|
31
|
|
- project_dir.join("js").join("index.js"),
|
32
|
|
- "window.onload = function () { alert() }",
|
33
|
|
- )
|
34
|
|
- .unwrap();
|
35
|
29
|
fs::write(
|
36
|
30
|
project_dir.join("templates").join("layout.html"),
|
37
|
31
|
"<html><head><title>{{ page_title }}</title></head><body>{{ contents }}</body></html>",
|
|
@@ -112,12 +106,7 @@ fn test_build() {
|
112
|
106
|
|
113
|
107
|
assert_eq!(
|
114
|
108
|
"body { background: blue; }",
|
115
|
|
- fs::read_to_string(project_dir.join("public").join("css").join("style.css")).unwrap()
|
116
|
|
- );
|
117
|
|
-
|
118
|
|
- assert_eq!(
|
119
|
|
- "window.onload = function () { alert() }",
|
120
|
|
- fs::read_to_string(project_dir.join("public").join("js").join("index.js")).unwrap()
|
|
109
|
+ fs::read_to_string(project_dir.join("public").join("assets").join("style.css")).unwrap()
|
121
|
110
|
);
|
122
|
111
|
}
|
123
|
112
|
|
|
@@ -130,9 +119,8 @@ fn test_build_drafts() {
|
130
|
119
|
fs::create_dir(&project_dir).unwrap();
|
131
|
120
|
env::set_current_dir(&project_dir).unwrap();
|
132
|
121
|
|
133
|
|
- fs::create_dir(&project_dir.join("css")).unwrap();
|
|
122
|
+ fs::create_dir(&project_dir.join("assets")).unwrap();
|
134
|
123
|
fs::create_dir(&project_dir.join("drafts")).unwrap();
|
135
|
|
- fs::create_dir(&project_dir.join("js")).unwrap();
|
136
|
124
|
fs::create_dir(&project_dir.join("pages")).unwrap();
|
137
|
125
|
fs::create_dir(&project_dir.join("posts")).unwrap();
|
138
|
126
|
fs::create_dir(&project_dir.join("public")).unwrap();
|
|
@@ -140,15 +128,10 @@ fn test_build_drafts() {
|
140
|
128
|
fs::create_dir(&project_dir.join("templates")).unwrap();
|
141
|
129
|
|
142
|
130
|
fs::write(
|
143
|
|
- project_dir.join("css").join("style.css"),
|
|
131
|
+ project_dir.join("assets").join("style.css"),
|
144
|
132
|
"body { background: blue; }",
|
145
|
133
|
)
|
146
|
134
|
.unwrap();
|
147
|
|
- fs::write(
|
148
|
|
- project_dir.join("js").join("index.js"),
|
149
|
|
- "window.onload = function () { alert() }",
|
150
|
|
- )
|
151
|
|
- .unwrap();
|
152
|
135
|
fs::write(
|
153
|
136
|
project_dir.join("templates").join("layout.html"),
|
154
|
137
|
"<html><head><title>{{ page_title }}</title></head><body>{{ contents }}</body></html>",
|
|
@@ -288,14 +271,6 @@ fn test_new() {
|
288
|
271
|
.replace("\n", "")
|
289
|
272
|
.replace(" ", "")
|
290
|
273
|
);
|
291
|
|
- assert_eq!(
|
292
|
|
- "",
|
293
|
|
- fs::read_to_string(&project_dir.join("css").join("style.css")).unwrap()
|
294
|
|
- );
|
295
|
|
- assert_eq!(
|
296
|
|
- "",
|
297
|
|
- fs::read_to_string(&project_dir.join("js").join("index.js")).unwrap()
|
298
|
|
- );
|
299
|
274
|
assert_eq!(
|
300
|
275
|
format!("site_name = \"{}\"", &uuid),
|
301
|
276
|
fs::read_to_string(&project_dir.join("casaubon.toml")).unwrap()
|