mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Update a test to not clone the real index
A local index should work ok!
This commit is contained in:
parent
adadfab5dd
commit
d6d1f3ab7d
@ -2,6 +2,8 @@ use std::fs::{self, File};
|
|||||||
use std::io::prelude::*;
|
use std::io::prelude::*;
|
||||||
|
|
||||||
use cargotest::support::{project, execs};
|
use cargotest::support::{project, execs};
|
||||||
|
use cargotest::support::registry::Package;
|
||||||
|
use cargotest::ChannelChanger;
|
||||||
use hamcrest::{assert_that, existing_file, is_not};
|
use hamcrest::{assert_that, existing_file, is_not};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -73,7 +75,8 @@ fn adding_and_removing_packages() {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn no_index_update() {
|
fn no_index_update() {
|
||||||
use cargotest::ChannelChanger;
|
Package::new("serde", "1.0.0").publish();
|
||||||
|
|
||||||
let p = project("foo")
|
let p = project("foo")
|
||||||
.file("Cargo.toml", r#"
|
.file("Cargo.toml", r#"
|
||||||
[package]
|
[package]
|
||||||
@ -88,12 +91,12 @@ fn no_index_update() {
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
assert_that(p.cargo("generate-lockfile"),
|
assert_that(p.cargo("generate-lockfile"),
|
||||||
execs().with_stdout("")
|
execs().with_stderr("\
|
||||||
.with_stderr_contains(" Updating registry `https://github.com/rust-lang/crates.io-index`"));
|
[UPDATING] registry `[..]`
|
||||||
|
"));
|
||||||
|
|
||||||
assert_that(p.cargo("generate-lockfile").masquerade_as_nightly_cargo().arg("-Zno-index-update"),
|
assert_that(p.cargo("generate-lockfile").masquerade_as_nightly_cargo().arg("-Zno-index-update"),
|
||||||
execs().with_status(0).with_stdout("")
|
execs().with_status(0).with_stdout("").with_stderr(""));
|
||||||
.with_stderr_does_not_contain(" Updating registry `https://github.com/rust-lang/crates.io-index`"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user