Skip to content

Commit

Permalink
test: add test for install without dry-run option
Browse files Browse the repository at this point in the history
  • Loading branch information
Flowrey committed Jul 22, 2024
1 parent 8a8b99f commit 28fa99d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/testsuite/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2730,3 +2730,24 @@ fn uninstall_running_binary() {
"#]]).run();
}

#[cargo_test]
fn dry_run() {
pkg("foo", "0.0.1");

cargo_process("install foo")
.with_stderr_data(str![[r#"
[UPDATING] `dummy-registry` index
[DOWNLOADING] crates ...
[DOWNLOADED] foo v0.0.1 (registry `dummy-registry`)
[INSTALLING] foo v0.0.1
[COMPILING] foo v0.0.1
[FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s
[INSTALLING] [ROOT]/home/.cargo/bin/foo[EXE]
[INSTALLED] package `foo v0.0.1` (executable `foo[EXE]`)
[WARNING] be sure to add `[ROOT]/home/.cargo/bin` to your PATH to be able to run the installed binaries
"#]])
.run();
assert_has_installed_exe(paths::cargo_home(), "foo");
}

0 comments on commit 28fa99d

Please sign in to comment.