From: Alex Crichton Date: Sun, 4 Mar 2018 20:51:31 +0000 (-0800) Subject: Update a test to not clone the real index X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~2^2~62^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d6d1f3ab7d15587d092b291970ca09f21b2d156f;p=cargo.git Update a test to not clone the real index A local index should work ok! --- diff --git a/tests/testsuite/generate_lockfile.rs b/tests/testsuite/generate_lockfile.rs index 8419df169..0e2e2a0ea 100644 --- a/tests/testsuite/generate_lockfile.rs +++ b/tests/testsuite/generate_lockfile.rs @@ -2,6 +2,8 @@ use std::fs::{self, File}; use std::io::prelude::*; use cargotest::support::{project, execs}; +use cargotest::support::registry::Package; +use cargotest::ChannelChanger; use hamcrest::{assert_that, existing_file, is_not}; #[test] @@ -73,7 +75,8 @@ fn adding_and_removing_packages() { #[test] fn no_index_update() { - use cargotest::ChannelChanger; + Package::new("serde", "1.0.0").publish(); + let p = project("foo") .file("Cargo.toml", r#" [package] @@ -88,12 +91,12 @@ fn no_index_update() { .build(); assert_that(p.cargo("generate-lockfile"), - execs().with_stdout("") - .with_stderr_contains(" Updating registry `https://github.com/rust-lang/crates.io-index`")); + execs().with_stderr("\ +[UPDATING] registry `[..]` +")); assert_that(p.cargo("generate-lockfile").masquerade_as_nightly_cargo().arg("-Zno-index-update"), - execs().with_status(0).with_stdout("") - .with_stderr_does_not_contain(" Updating registry `https://github.com/rust-lang/crates.io-index`")); + execs().with_status(0).with_stdout("").with_stderr("")); } #[test]