aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/init.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-11 02:36:42 +0900
committernsfisis <nsfisis@gmail.com>2026-05-11 02:36:42 +0900
commit4e99773a3d203e73b8bf6464490d05649a269fa7 (patch)
tree7a6f1a7f773a14ea72dc2f9ff4124badd345833d /crates/mozart/src/commands/init.rs
parent4df5f8491320e5795718cf0222e80fa27e57c8ad (diff)
downloadphp-mozart-4e99773a3d203e73b8bf6464490d05649a269fa7.tar.gz
php-mozart-4e99773a3d203e73b8bf6464490d05649a269fa7.tar.zst
php-mozart-4e99773a3d203e73b8bf6464490d05649a269fa7.zip
test(commands): remove per-command tests
Diffstat (limited to 'crates/mozart/src/commands/init.rs')
-rw-r--r--crates/mozart/src/commands/init.rs49
1 files changed, 0 insertions, 49 deletions
diff --git a/crates/mozart/src/commands/init.rs b/crates/mozart/src/commands/init.rs
index 4598d39..4fb6c3f 100644
--- a/crates/mozart/src/commands/init.rs
+++ b/crates/mozart/src/commands/init.rs
@@ -846,52 +846,3 @@ fn add_vendor_ignore(gitignore_path: &Path) -> anyhow::Result<()> {
std::fs::write(gitignore_path, contents)?;
Ok(())
}
-
-#[cfg(test)]
-mod tests {
- use super::*;
-
- #[test]
- fn parse_repositories_http_url_yields_composer_type() {
- let repos = parse_repositories(&["https://repo.example.com".to_string()]).unwrap();
- assert_eq!(repos.len(), 1);
- assert_eq!(repos[0].repo_type, "composer");
- assert_eq!(repos[0].url.as_deref(), Some("https://repo.example.com"));
- }
-
- #[test]
- fn parse_repositories_http_scheme_also_matches() {
- let repos = parse_repositories(&["http://example.com".to_string()]).unwrap();
- assert_eq!(repos[0].repo_type, "composer");
- }
-
- #[test]
- fn parse_repositories_json_object_preserved() {
- let repos = parse_repositories(&[
- r#"{"type":"vcs","url":"https://github.com/acme/repo"}"#.to_string()
- ])
- .unwrap();
- assert_eq!(repos[0].repo_type, "vcs");
- assert_eq!(
- repos[0].url.as_deref(),
- Some("https://github.com/acme/repo")
- );
- }
-
- #[test]
- fn parse_repositories_unknown_form_is_error() {
- let err = parse_repositories(&["not-a-url-or-json".to_string()]).unwrap_err();
- assert!(
- err.to_string()
- .contains("Has to be a .json file, an http url or a JSON object"),
- "{err}",
- );
- }
-
- #[test]
- fn parse_repositories_json_without_type_is_error() {
- let err =
- parse_repositories(&[r#"{"url":"https://example.com"}"#.to_string()]).unwrap_err();
- assert!(err.to_string().contains("'type'"), "{err}");
- }
-}