cargo/tests/test_cargo_package.rs
Alex Crichton 69c16fc6c8 Implement cargo-package
This command will assemble the current package into a tarball ready for
uploading to the cargo registry. Currently no further verification is done
beyond packaging the local repository into a tarball, but in the future this
could execute other operations such as api stability tools.
2014-08-26 19:03:12 -07:00

28 lines
679 B
Rust

use support::{project, execs};
use support::{PACKAGING};
use hamcrest::{assert_that, existing_file};
fn setup() {
}
test!(simple {
let p = project("foo")
.file("Cargo.toml", r#"
[project]
name = "foo"
version = "0.0.1"
authors = []
"#)
.file("src/main.rs", r#"
fn main() { println!("hello"); }
"#);
assert_that(p.cargo_process("package"),
execs().with_status(0).with_stdout(format!("\
{packaging} foo v0.0.1 ({dir})
",
packaging = PACKAGING,
dir = p.url()).as_slice()));
assert_that(&p.root().join("foo-0.0.1.tar.gz"), existing_file());
})