Skip to content

Commit

Permalink
Add tests for passing both --bin and --lib
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Turner committed Jul 29, 2016
1 parent a882abe commit a0a7752
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ fn simple_bin() {
existing_file());
}

#[test]
fn both_lib_and_bin() {
let td = TempDir::new("cargo").unwrap();
assert_that(cargo_process("init").arg("--lib").arg("--bin").cwd(td.path().clone())
.env("USER", "foo"),
execs().with_status(101).with_stderr(
"[ERROR] can't specify both lib and binary outputs"));
}

fn bin_already_exists(explicit: bool, rellocation: &str) {
let path = paths::root().join("foo");
fs::create_dir_all(&path.join("src")).unwrap();
Expand Down
9 changes: 9 additions & 0 deletions tests/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ fn simple_bin() {
existing_file());
}

#[test]
fn both_lib_and_bin() {
let td = TempDir::new("cargo").unwrap();
assert_that(cargo_process("new").arg("--lib").arg("--bin").arg("foo").cwd(td.path().clone())
.env("USER", "foo"),
execs().with_status(101).with_stderr(
"[ERROR] can't specify both lib and binary outputs"));
}

#[test]
fn simple_git() {
let td = TempDir::new("cargo").unwrap();
Expand Down

0 comments on commit a0a7752

Please sign in to comment.