Skip to content

Commit

Permalink
Remove tests related to stripping names.
Browse files Browse the repository at this point in the history
  • Loading branch information
boats committed Feb 5, 2018
1 parent 3e7c75a commit e101b92
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions tests/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,37 +163,6 @@ fn keyword_name() {
use --name to override crate name"));
}

#[test]
fn rust_prefix_stripped() {
assert_that(cargo_process("new").arg("--lib").arg("rust-foo").env("USER", "foo"),
execs().with_status(0)
.with_stderr_contains("note: package will be named `foo`; use --name to override"));
let toml = paths::root().join("rust-foo/Cargo.toml");
let mut contents = String::new();
File::open(&toml).unwrap().read_to_string(&mut contents).unwrap();
assert!(contents.contains(r#"name = "foo""#));
}

#[test]
fn bin_disables_stripping() {
assert_that(cargo_process("new").arg("rust-foo").arg("--bin").env("USER", "foo"),
execs().with_status(0));
let toml = paths::root().join("rust-foo/Cargo.toml");
let mut contents = String::new();
File::open(&toml).unwrap().read_to_string(&mut contents).unwrap();
assert!(contents.contains(r#"name = "rust-foo""#));
}

#[test]
fn explicit_name_not_stripped() {
assert_that(cargo_process("new").arg("foo").arg("--name").arg("rust-bar").env("USER", "foo"),
execs().with_status(0));
let toml = paths::root().join("foo/Cargo.toml");
let mut contents = String::new();
File::open(&toml).unwrap().read_to_string(&mut contents).unwrap();
assert!(contents.contains(r#"name = "rust-bar""#));
}

#[test]
fn finds_author_user() {
create_empty_gitconfig();
Expand Down Expand Up @@ -423,4 +392,4 @@ fn explicit_invalid_name_not_suggested() {
execs().with_status(101)
.with_stderr("\
[ERROR] Package names starting with a digit cannot be used as a crate name"));
}
}

0 comments on commit e101b92

Please sign in to comment.