@@ -32,21 +32,10 @@ fn basic_project() -> Project {
32
32
. build ( )
33
33
}
34
34
35
- fn docs_rs ( p : & Project ) {
36
- p. change_file (
37
- ".cargo/config" ,
38
- r#"
39
- [doc.extern-map.registries]
40
- crates-io = "https://docs.rs/"
41
- "# ,
42
- ) ;
43
- }
44
-
45
35
#[ cargo_test]
46
36
fn ignores_on_stable ( ) {
47
37
// Requires -Zrustdoc-map to use.
48
38
let p = basic_project ( ) ;
49
- docs_rs ( & p) ;
50
39
p. cargo ( "doc -v --no-deps" )
51
40
. with_stderr_does_not_contain ( "[..]--extern-html-root-url[..]" )
52
41
. run ( ) ;
@@ -60,7 +49,6 @@ fn simple() {
60
49
return ;
61
50
}
62
51
let p = basic_project ( ) ;
63
- docs_rs ( & p) ;
64
52
p. cargo ( "doc -v --no-deps -Zrustdoc-map" )
65
53
. masquerade_as_nightly_cargo ( )
66
54
. with_stderr_contains (
@@ -157,7 +145,6 @@ fn renamed_dep() {
157
145
"# ,
158
146
)
159
147
. build ( ) ;
160
- docs_rs ( & p) ;
161
148
p. cargo ( "doc -v --no-deps -Zrustdoc-map" )
162
149
. masquerade_as_nightly_cargo ( )
163
150
. with_stderr_contains (
@@ -211,7 +198,6 @@ fn lib_name() {
211
198
"# ,
212
199
)
213
200
. build ( ) ;
214
- docs_rs ( & p) ;
215
201
p. cargo ( "doc -v --no-deps -Zrustdoc-map" )
216
202
. masquerade_as_nightly_cargo ( )
217
203
. with_stderr_contains (
@@ -338,7 +324,6 @@ fn multiple_versions() {
338
324
" ,
339
325
)
340
326
. build ( ) ;
341
- docs_rs ( & p) ;
342
327
p. cargo ( "doc -v --no-deps -Zrustdoc-map" )
343
328
. masquerade_as_nightly_cargo ( )
344
329
. with_stderr_contains (
@@ -364,12 +349,21 @@ fn rebuilds_when_changing() {
364
349
let p = basic_project ( ) ;
365
350
p. cargo ( "doc -v --no-deps -Zrustdoc-map" )
366
351
. masquerade_as_nightly_cargo ( )
367
- . with_stderr_does_not_contain ( "[..]--extern-html-root-url[..]" )
352
+ . with_stderr_contains ( "[..]--extern-html-root-url[..]" )
368
353
. run ( ) ;
369
354
370
- docs_rs ( & p) ;
355
+ // This also tests that the map for docs.rs can be overridden.
356
+ p. change_file (
357
+ ".cargo/config" ,
358
+ r#"
359
+ [doc.extern-map.registries]
360
+ crates-io = "https://example.com/"
361
+ "# ,
362
+ ) ;
371
363
p. cargo ( "doc -v --no-deps -Zrustdoc-map" )
372
364
. masquerade_as_nightly_cargo ( )
373
- . with_stderr_contains ( "[..]--extern-html-root-url[..]" )
365
+ . with_stderr_contains (
366
+ "[RUNNING] `rustdoc [..]--extern-html-root-url [..]bar=https://example.com/bar/1.0.0/[..]" ,
367
+ )
374
368
. run ( ) ;
375
369
}
0 commit comments