Skip to content

Commit

Permalink
Test that the path argument works
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 committed Dec 1, 2022
1 parent da32f12 commit 95fce4a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,22 @@ fn golden_reference(args: &[&str], file: &str) -> TestResult {
Ok(())
}

#[test]
fn path() -> TestResult {
let (_, target) = build("sample-project")?;
let mut cmd = Command::new(cargo_bin("cargo-sweep"));

cmd.arg("sweep").arg("--installed").current_dir("/tmp");

// Pass `path` as an argument, instead of `current_dir` like it normally is.
let assert = run(cmd
.arg(project_dir("sample-project"))
.env("CARGO_TARGET_DIR", target.path()));
assert.stdout(contains("Cleaned"));

Ok(())
}

#[test]
fn subcommand_usage() -> TestResult {
golden_reference(&["sweep", "-h"], "tests/usage.txt")
Expand Down

0 comments on commit 95fce4a

Please sign in to comment.