Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump hamcrest to 0.1.5 #4886

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ winapi = "0.2"
bufstream = "0.1"
cargotest = { path = "tests/cargotest" }
filetime = "0.1"
hamcrest = "=0.1.1"
hamcrest = "=0.1.5"

[[bin]]
name = "cargo"
Expand Down
39 changes: 20 additions & 19 deletions tests/alt-registry.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
extern crate cargotest;
#[macro_use]
extern crate hamcrest;

use cargotest::ChannelChanger;
use cargotest::support::registry::{self, Package, alt_api_path};
use cargotest::support::{project, execs};
use hamcrest::assert_that;
use hamcrest::prelude::*;

#[test]
fn is_feature_gated() {
Expand All @@ -24,7 +25,7 @@ fn is_feature_gated() {

Package::new("bar", "0.0.1").alternative(true).publish();

assert_that(p.cargo("build").masquerade_as_nightly_cargo(),
assert_that!(p.cargo("build").masquerade_as_nightly_cargo(),
execs().with_status(101)
.with_stderr_contains(" feature `alternative-registries` is required"));
}
Expand All @@ -49,7 +50,7 @@ fn depend_on_alt_registry() {

Package::new("bar", "0.0.1").alternative(true).publish();

assert_that(p.cargo("build").masquerade_as_nightly_cargo(),
assert_that!(p.cargo("build").masquerade_as_nightly_cargo(),
execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `{reg}`
[DOWNLOADING] bar v0.0.1 (registry `file://[..]`)
Expand All @@ -60,10 +61,10 @@ fn depend_on_alt_registry() {
dir = p.url(),
reg = registry::alt_registry())));

assert_that(p.cargo("clean").masquerade_as_nightly_cargo(), execs().with_status(0));
assert_that!(p.cargo("clean").masquerade_as_nightly_cargo(), execs().with_status(0));

// Don't download a second time
assert_that(p.cargo("build").masquerade_as_nightly_cargo(),
assert_that!(p.cargo("build").masquerade_as_nightly_cargo(),
execs().with_status(0).with_stderr(&format!("\
[COMPILING] bar v0.0.1 (registry `file://[..]`)
[COMPILING] foo v0.0.1 ({dir})
Expand Down Expand Up @@ -93,7 +94,7 @@ fn depend_on_alt_registry_depends_on_same_registry_no_index() {
Package::new("baz", "0.0.1").alternative(true).publish();
Package::new("bar", "0.0.1").dep("baz", "0.0.1").alternative(true).publish();

assert_that(p.cargo("build").masquerade_as_nightly_cargo(),
assert_that!(p.cargo("build").masquerade_as_nightly_cargo(),
execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `{reg}`
[DOWNLOADING] [..] v0.0.1 (registry `file://[..]`)
Expand Down Expand Up @@ -128,7 +129,7 @@ fn depend_on_alt_registry_depends_on_same_registry() {
Package::new("baz", "0.0.1").alternative(true).publish();
Package::new("bar", "0.0.1").registry_dep("baz", "0.0.1", registry::alt_registry().as_str()).alternative(true).publish();

assert_that(p.cargo("build").masquerade_as_nightly_cargo(),
assert_that!(p.cargo("build").masquerade_as_nightly_cargo(),
execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `{reg}`
[DOWNLOADING] [..] v0.0.1 (registry `file://[..]`)
Expand Down Expand Up @@ -163,7 +164,7 @@ fn depend_on_alt_registry_depends_on_crates_io() {
Package::new("baz", "0.0.1").publish();
Package::new("bar", "0.0.1").registry_dep("baz", "0.0.1", registry::registry().as_str()).alternative(true).publish();

assert_that(p.cargo("build").masquerade_as_nightly_cargo(),
assert_that!(p.cargo("build").masquerade_as_nightly_cargo(),
execs().with_status(0).with_stderr(&format!("\
[UPDATING] registry `{alt_reg}`
[UPDATING] registry `{reg}`
Expand Down Expand Up @@ -197,7 +198,7 @@ fn registry_incompatible_with_path() {
.file("src/main.rs", "fn main() {}")
.build();

assert_that(p.cargo("build").masquerade_as_nightly_cargo(),
assert_that!(p.cargo("build").masquerade_as_nightly_cargo(),
execs().with_status(101)
.with_stderr_contains(" dependency (bar) specification is ambiguous. Only one of `path` or `registry` is allowed."));
}
Expand All @@ -220,7 +221,7 @@ fn registry_incompatible_with_git() {
.file("src/main.rs", "fn main() {}")
.build();

assert_that(p.cargo("build").masquerade_as_nightly_cargo(),
assert_that!(p.cargo("build").masquerade_as_nightly_cargo(),
execs().with_status(101)
.with_stderr_contains(" dependency (bar) specification is ambiguous. Only one of `git` or `registry` is allowed."));
}
Expand All @@ -243,7 +244,7 @@ fn cannot_publish_to_crates_io_with_registry_dependency() {

Package::new("bar", "0.0.1").alternative(true).publish();

assert_that(p.cargo("publish").masquerade_as_nightly_cargo()
assert_that!(p.cargo("publish").masquerade_as_nightly_cargo()
.arg("--index").arg(registry::registry().to_string()),
execs().with_status(101));
}
Expand All @@ -269,11 +270,11 @@ fn publish_with_registry_dependency() {
Package::new("bar", "0.0.1").alternative(true).publish();

// Login so that we have the token available
assert_that(p.cargo("login").masquerade_as_nightly_cargo()
assert_that!(p.cargo("login").masquerade_as_nightly_cargo()
.arg("--registry").arg("alternative").arg("TOKEN").arg("-Zunstable-options"),
execs().with_status(0));

assert_that(p.cargo("publish").masquerade_as_nightly_cargo()
assert_that!(p.cargo("publish").masquerade_as_nightly_cargo()
.arg("--registry").arg("alternative").arg("-Zunstable-options"),
execs().with_status(0));
}
Expand Down Expand Up @@ -303,7 +304,7 @@ fn alt_registry_and_crates_io_deps() {
Package::new("crates_io_dep", "0.0.1").publish();
Package::new("alt_reg_dep", "0.1.0").alternative(true).publish();

assert_that(p.cargo("build").masquerade_as_nightly_cargo(),
assert_that!(p.cargo("build").masquerade_as_nightly_cargo(),
execs().with_status(0)
.with_stderr_contains(format!("\
[UPDATING] registry `{}`", registry::alt_registry()))
Expand Down Expand Up @@ -340,7 +341,7 @@ fn block_publish_due_to_no_token() {
Package::new("bar", "0.0.1").alternative(true).publish();

// Now perform the actual publish
assert_that(p.cargo("publish").masquerade_as_nightly_cargo()
assert_that!(p.cargo("publish").masquerade_as_nightly_cargo()
.arg("--registry").arg("alternative").arg("-Zunstable-options"),
execs().with_status(101)
.with_stderr_contains("error: no upload token found, please run `cargo login`"));
Expand All @@ -364,12 +365,12 @@ fn publish_to_alt_registry() {
Package::new("bar", "0.0.1").alternative(true).publish();

// Login so that we have the token available
assert_that(p.cargo("login").masquerade_as_nightly_cargo()
assert_that!(p.cargo("login").masquerade_as_nightly_cargo()
.arg("--registry").arg("alternative").arg("TOKEN").arg("-Zunstable-options"),
execs().with_status(0));

// Now perform the actual publish
assert_that(p.cargo("publish").masquerade_as_nightly_cargo()
assert_that!(p.cargo("publish").masquerade_as_nightly_cargo()
.arg("--registry").arg("alternative").arg("-Zunstable-options"),
execs().with_status(0));

Expand Down Expand Up @@ -399,11 +400,11 @@ fn publish_with_crates_io_dep() {
Package::new("bar", "0.0.1").publish();

// Login so that we have the token available
assert_that(p.cargo("login").masquerade_as_nightly_cargo()
assert_that!(p.cargo("login").masquerade_as_nightly_cargo()
.arg("--registry").arg("alternative").arg("TOKEN").arg("-Zunstable-options"),
execs().with_status(0));

assert_that(p.cargo("publish").masquerade_as_nightly_cargo()
assert_that!(p.cargo("publish").masquerade_as_nightly_cargo()
.arg("--registry").arg("alternative").arg("-Zunstable-options"),
execs().with_status(0));
}
Loading