Skip to content

Commit 2659f40

Browse files
committed
Auto merge of #5119 - alexcrichton:no-clone-index-in-tests, r=matklad
Update a test to not clone the real index A local index should work ok!
2 parents cd230ad + d6d1f3a commit 2659f40

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tests/testsuite/generate_lockfile.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ use std::fs::{self, File};
22
use std::io::prelude::*;
33

44
use cargotest::support::{project, execs};
5+
use cargotest::support::registry::Package;
6+
use cargotest::ChannelChanger;
57
use hamcrest::{assert_that, existing_file, is_not};
68

79
#[test]
@@ -73,7 +75,8 @@ fn adding_and_removing_packages() {
7375

7476
#[test]
7577
fn no_index_update() {
76-
use cargotest::ChannelChanger;
78+
Package::new("serde", "1.0.0").publish();
79+
7780
let p = project("foo")
7881
.file("Cargo.toml", r#"
7982
[package]
@@ -88,12 +91,12 @@ fn no_index_update() {
8891
.build();
8992

9093
assert_that(p.cargo("generate-lockfile"),
91-
execs().with_stdout("")
92-
.with_stderr_contains(" Updating registry `https://github.com/rust-lang/crates.io-index`"));
94+
execs().with_stderr("\
95+
[UPDATING] registry `[..]`
96+
"));
9397

9498
assert_that(p.cargo("generate-lockfile").masquerade_as_nightly_cargo().arg("-Zno-index-update"),
95-
execs().with_status(0).with_stdout("")
96-
.with_stderr_does_not_contain(" Updating registry `https://github.com/rust-lang/crates.io-index`"));
99+
execs().with_status(0).with_stdout("").with_stderr(""));
97100
}
98101

99102
#[test]

0 commit comments

Comments
 (0)