Skip to content

Commit

Permalink
Auto merge of #77 - caulagi:bug/fix-cargo-install, r=killercup
Browse files Browse the repository at this point in the history
Move Cargo.toml files in test directories to fix problems with cargo install

 As discussed in #68, I moved the Cargo.toml files in tests to Cargo.to.sample and changed the tests to refer to the new file name.
  • Loading branch information
homu committed Mar 2, 2016
2 parents 800eb10 + c8463a1 commit 8798cea
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions tests/cargo-list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ extern crate assert_cli;
#[test]
fn listing() {
assert_cli!("target/debug/cargo-list",
&["list", "--manifest-path=tests/fixtures/list/Cargo.toml"] =>
&["list", "--manifest-path=tests/fixtures/list/Cargo.toml.sample"] =>
Success, r#"cargo-edit path: "../../../"
clippy git: "https://github.com/Manishearth/rust-clippy.git" (optional)
docopt 0.6
Expand All @@ -18,15 +18,15 @@ toml 0.1"#)
#[test]
fn listing_dev() {
assert_cli!("target/debug/cargo-list",
&["list", "--dev", "--manifest-path=tests/fixtures/list/Cargo.toml"] =>
&["list", "--dev", "--manifest-path=tests/fixtures/list/Cargo.toml.sample"] =>
Success, r#"term 0.2.12"#)
.unwrap();
}

#[test]
fn listing_build() {
assert_cli!("target/debug/cargo-list",
&["list", "--build", "--manifest-path=tests/fixtures/list/Cargo.toml"] =>
&["list", "--build", "--manifest-path=tests/fixtures/list/Cargo.toml.sample"] =>
Success, r#"gcc 0.3.19"#)
.unwrap();
}
Expand All @@ -35,17 +35,17 @@ fn listing_build() {
fn treat_missing_section_as_empty() {
// empty dependencies
assert_cli!("target/debug/cargo-list",
&["list", "--manifest-path=tests/fixtures/list-empty/Cargo.toml"] =>
&["list", "--manifest-path=tests/fixtures/list-empty/Cargo.toml.sample"] =>
Success, "\n").unwrap();

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

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

Expand Down
14 changes: 7 additions & 7 deletions tests/cargo-rm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use utils::{clone_out_test, execute_command, get_toml};

#[test]
fn remove_existing_dependency() {
let (_tmpdir, manifest) = clone_out_test("tests/fixtures/rm/Cargo.toml");
let (_tmpdir, manifest) = clone_out_test("tests/fixtures/rm/Cargo.toml.sample");

let toml = get_toml(&manifest);
assert!(toml.lookup("dependencies.docopt").is_some());
Expand All @@ -17,7 +17,7 @@ fn remove_existing_dependency() {

#[test]
fn remove_existing_dependency_from_specific_section() {
let (_tmpdir, manifest) = clone_out_test("tests/fixtures/rm/Cargo.toml");
let (_tmpdir, manifest) = clone_out_test("tests/fixtures/rm/Cargo.toml.sample");

// Test removing dev dependency.
let toml = get_toml(&manifest);
Expand All @@ -36,7 +36,7 @@ fn remove_existing_dependency_from_specific_section() {

#[test]
fn remove_section_after_removed_last_dependency() {
let (_tmpdir, manifest) = clone_out_test("tests/fixtures/rm/Cargo.toml");
let (_tmpdir, manifest) = clone_out_test("tests/fixtures/rm/Cargo.toml.sample");

let toml = get_toml(&manifest);
assert!(toml.lookup("dev-dependencies.regex").is_some());
Expand All @@ -53,7 +53,7 @@ fn remove_section_after_removed_last_dependency() {
// https://github.com/killercup/cargo-edit/issues/32
#[test]
fn issue_32() {
let (_tmpdir, manifest) = clone_out_test("tests/fixtures/rm/Cargo.toml");
let (_tmpdir, manifest) = clone_out_test("tests/fixtures/rm/Cargo.toml.sample");

let toml = get_toml(&manifest);
assert!(toml.lookup("dependencies.foo").is_none());
Expand All @@ -75,7 +75,7 @@ fn issue_32() {

#[test]
fn invalid_dependency() {
let (_tmpdir, manifest) = clone_out_test("tests/fixtures/rm/Cargo.toml");
let (_tmpdir, manifest) = clone_out_test("tests/fixtures/rm/Cargo.toml.sample");

assert_cli!("target/debug/cargo-rm",
&["rm", "invalid_dependency_name", &format!("--manifest-path={}", manifest)]
Expand All @@ -87,7 +87,7 @@ ERROR: The dependency `invalid_dependency_name` could not be found in `dependenc

#[test]
fn invalid_section() {
let (_tmpdir, manifest) = clone_out_test("tests/fixtures/rm/Cargo.toml");
let (_tmpdir, manifest) = clone_out_test("tests/fixtures/rm/Cargo.toml.sample");

execute_command(&["rm", "semver", "--build"], &manifest);
assert_cli!("target/debug/cargo-rm",
Expand All @@ -100,7 +100,7 @@ ERROR: The table `build-dependencies` could not be found.")

#[test]
fn invalid_dependency_in_section() {
let (_tmpdir, manifest) = clone_out_test("tests/fixtures/rm/Cargo.toml");
let (_tmpdir, manifest) = clone_out_test("tests/fixtures/rm/Cargo.toml.sample");

assert_cli!("target/debug/cargo-rm",
&["rm", "semver", "--dev", &format!("--manifest-path={}", manifest)]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 8798cea

Please sign in to comment.