aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/tests/cli_install.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/mozart/tests/cli_install.rs')
-rw-r--r--crates/mozart/tests/cli_install.rs52
1 files changed, 52 insertions, 0 deletions
diff --git a/crates/mozart/tests/cli_install.rs b/crates/mozart/tests/cli_install.rs
new file mode 100644
index 0000000..5312956
--- /dev/null
+++ b/crates/mozart/tests/cli_install.rs
@@ -0,0 +1,52 @@
+mod common;
+
+use predicates::str::contains;
+
+#[test]
+fn test_install_dry_run() {
+ let project = common::copy_fixture_to_temp("with_lock");
+ common::mozart_cmd()
+ .arg("install")
+ .arg("--dry-run")
+ .arg("--working-dir")
+ .arg(project.path())
+ .assert()
+ .success()
+ .stderr(contains("Installing"));
+}
+
+#[test]
+fn test_install_no_lock_file() {
+ let project = common::copy_fixture_to_temp("minimal");
+ common::mozart_cmd()
+ .arg("install")
+ .arg("--working-dir")
+ .arg(project.path())
+ .assert()
+ .failure()
+ .stderr(contains("mozart update"));
+}
+
+#[test]
+fn test_install_no_composer_json() {
+ let project = tempfile::TempDir::new().unwrap();
+ common::mozart_cmd()
+ .arg("install")
+ .arg("--working-dir")
+ .arg(project.path())
+ .assert()
+ .failure();
+}
+
+#[test]
+fn test_install_dry_run_shows_package_names() {
+ let project = common::copy_fixture_to_temp("with_lock");
+ common::mozart_cmd()
+ .arg("install")
+ .arg("--dry-run")
+ .arg("--working-dir")
+ .arg(project.path())
+ .assert()
+ .success()
+ .stderr(contains("psr/log"));
+}