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

Move Cargo.toml files in test directories to fix problems with cargo install #77

Merged
merged 1 commit into from
Mar 2, 2016
Merged
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
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.