Skip to content

Commit

Permalink
Add Integration Tests for Listing Empty Deps
Browse files Browse the repository at this point in the history
  • Loading branch information
killercup committed Oct 24, 2015
1 parent 923938f commit 225b35e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 10 deletions.
38 changes: 28 additions & 10 deletions tests/cargo-list.rs
@@ -1,6 +1,20 @@
#[macro_use]
extern crate assert_cli;

#[test]
fn listing() {
assert_cli!("target/debug/cargo-list",
&["list", "--manifest-path=tests/fixtures/list/Cargo.toml"] =>
Success, r#"cargo-edit path: "../../../"
clippy git: "https://github.com/Manishearth/rust-clippy.git" (optional)
docopt 0.6
pad 0.1
rustc-serialize 0.3
semver 0.1
toml 0.1"#)
.unwrap();
}

#[test]
fn listing_dev() {
assert_cli!("target/debug/cargo-list",
Expand All @@ -18,17 +32,21 @@ fn listing_build() {
}

#[test]
fn listing() {
fn treat_missing_section_as_empty() {
// empty dependencies
assert_cli!("target/debug/cargo-list",
&["list", "--manifest-path=tests/fixtures/list/Cargo.toml"] =>
Success, r#"cargo-edit path: "../../../"
clippy git: "https://github.com/Manishearth/rust-clippy.git" (optional)
docopt 0.6
pad 0.1
rustc-serialize 0.3
semver 0.1
toml 0.1"#)
.unwrap();
&["list", "--manifest-path=tests/fixtures/list-empty/Cargo.toml"] =>
Success, "\n").unwrap();

// empty dev-dependencies
assert_cli!("target/debug/cargo-list",
&["list", "--dev", "--manifest-path=tests/fixtures/list-empty/Cargo.toml"] =>
Success, "\n").unwrap();

// empty build-dependencies
assert_cli!("target/debug/cargo-list",
&["list", "--build", "--manifest-path=tests/fixtures/list-empty/Cargo.toml"] =>
Success, "\n").unwrap();
}

#[test]
Expand Down
7 changes: 7 additions & 0 deletions tests/fixtures/list-empty/Cargo.toml
@@ -0,0 +1,7 @@
[package]
name = "cargo-list-empty-test-fixture"
version = "0.1.0"

[[bin]]
name = "main"
path = "src/main.rs"

0 comments on commit 225b35e

Please sign in to comment.