@@ -278,102 +278,102 @@ mod test {
278
278
279
279
#[test]
280
280
fn should_error_with_no_crates() {
281
- let config = parse_config(~ [~" rustdoc"]);
281
+ let config = parse_config([~" rustdoc"]);
282
282
assert!(config.get_err() == ~" no crates specified");
283
283
}
284
284
285
285
#[test]
286
286
fn should_error_with_multiple_crates() {
287
287
let config =
288
- parse_config(~ [~" rustdoc", ~" crate1. rc", ~" crate2. rc"]);
288
+ parse_config([~" rustdoc", ~" crate1. rc", ~" crate2. rc"]);
289
289
assert!(config.get_err() == ~" multiple crates specified");
290
290
}
291
291
292
292
#[test]
293
293
fn should_set_output_dir_to_cwd_if_not_provided() {
294
- let config = parse_config(~ [~" rustdoc", ~" crate . rc"]);
294
+ let config = parse_config([~" rustdoc", ~" crate . rc"]);
295
295
assert!(config.get().output_dir == Path(" . "));
296
296
}
297
297
298
298
#[test]
299
299
fn should_set_output_dir_if_provided() {
300
- let config = parse_config(~ [
300
+ let config = parse_config([
301
301
~" rustdoc", ~" crate . rc", ~" --output-dir", ~" snuggles"
302
302
]);
303
303
assert!(config.get().output_dir == Path(" snuggles"));
304
304
}
305
305
306
306
#[test]
307
307
fn should_set_output_format_to_pandoc_html_if_not_provided() {
308
- let config = parse_config(~ [~" rustdoc", ~" crate . rc"]);
308
+ let config = parse_config([~" rustdoc", ~" crate . rc"]);
309
309
assert!(config.get().output_format == PandocHtml);
310
310
}
311
311
312
312
#[test]
313
313
fn should_set_output_format_to_markdown_if_requested() {
314
- let config = parse_config(~ [
314
+ let config = parse_config([
315
315
~" rustdoc", ~" crate . rc", ~" --output-format", ~" markdown"
316
316
]);
317
317
assert!(config.get().output_format == Markdown);
318
318
}
319
319
320
320
#[test]
321
321
fn should_set_output_format_to_pandoc_html_if_requested() {
322
- let config = parse_config(~ [
322
+ let config = parse_config([
323
323
~" rustdoc", ~" crate . rc", ~" --output-format", ~" html"
324
324
]);
325
325
assert!(config.get().output_format == PandocHtml);
326
326
}
327
327
328
328
#[test]
329
329
fn should_error_on_bogus_format() {
330
- let config = parse_config(~ [
330
+ let config = parse_config([
331
331
~" rustdoc", ~" crate . rc", ~" --output-format", ~" bogus"
332
332
]);
333
333
assert!(config.get_err() == ~" unknown output format ' bogus' ");
334
334
}
335
335
336
336
#[test]
337
337
fn should_set_output_style_to_doc_per_mod_by_default() {
338
- let config = parse_config(~ [~" rustdoc", ~" crate . rc"]);
338
+ let config = parse_config([~" rustdoc", ~" crate . rc"]);
339
339
assert!(config.get().output_style == DocPerMod);
340
340
}
341
341
342
342
#[test]
343
343
fn should_set_output_style_to_one_doc_if_requested() {
344
- let config = parse_config(~ [
344
+ let config = parse_config([
345
345
~" rustdoc", ~" crate . rc", ~" --output-style", ~" doc-per-crate "
346
346
]);
347
347
assert!(config.get().output_style == DocPerCrate);
348
348
}
349
349
350
350
#[test]
351
351
fn should_set_output_style_to_doc_per_mod_if_requested() {
352
- let config = parse_config(~ [
352
+ let config = parse_config([
353
353
~" rustdoc", ~" crate . rc", ~" --output-style", ~" doc-per-mod "
354
354
]);
355
355
assert!(config.get().output_style == DocPerMod);
356
356
}
357
357
358
358
#[test]
359
359
fn should_error_on_bogus_output_style() {
360
- let config = parse_config(~ [
360
+ let config = parse_config([
361
361
~" rustdoc", ~" crate . rc", ~" --output-style", ~" bogus"
362
362
]);
363
363
assert!(config.get_err() == ~" unknown output style ' bogus' ");
364
364
}
365
365
366
366
#[test]
367
367
fn should_set_pandoc_command_if_requested() {
368
- let config = parse_config(~ [
368
+ let config = parse_config([
369
369
~" rustdoc", ~" crate . rc", ~" --pandoc-cmd", ~" panda-bear-doc"
370
370
]);
371
371
assert!(config.get().pandoc_cmd == Some(~" panda-bear-doc"));
372
372
}
373
373
374
374
#[test]
375
375
fn should_set_pandoc_command_when_using_pandoc() {
376
- let config = parse_config(~ [~" rustdoc", ~" crate . rc"]);
376
+ let config = parse_config([~" rustdoc", ~" crate . rc"]);
377
377
assert!(config.get().pandoc_cmd == Some(~" pandoc" ) ) ;
378
378
}
379
379
}
0 commit comments