Skip to content

Commit

Permalink
Verify cargo package rejects path dependencies.
Browse files Browse the repository at this point in the history
Port of the equivalent test from the `cargo publish` command.
  • Loading branch information
rillian committed Aug 31, 2016
1 parent 0fd0a9e commit 4f01c02
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,37 @@ fn package_verification() {
dir = p.url())));
}

#[test]
fn path_dependency_no_version() {
let p = project("foo")
.file("Cargo.toml", r#"
[project]
name = "foo"
version = "0.0.1"
authors = []
license = "MIT"
description = "foo"
[dependencies.bar]
path = "bar"
"#)
.file("src/main.rs", "fn main() {}")
.file("bar/Cargo.toml", r#"
[package]
name = "bar"
version = "0.0.1"
authors = []
"#)
.file("bar/src/lib.rs", "");

assert_that(p.cargo_process("package"),
execs().with_status(101).with_stderr("\
[WARNING] manifest has no documentation, homepage or repository. See http://doc.crates.io/manifest.html#package-metadata for more info.
[ERROR] all path dependencies must have a version specified when packaging.
dependency `bar` does not specify a version.
"));
}

#[test]
fn exclude() {
let p = project("foo")
Expand Down

0 comments on commit 4f01c02

Please sign in to comment.