1#![warn(missing_docs)]
18
19pub mod collector;
20pub mod errors;
21pub mod git;
22pub mod github;
23pub mod identity;
24pub mod jira;
25
26pub use collector::{CollectionPipeline, CollectionStats};
27pub use errors::{CollectError, Result};
28
29#[cfg(test)]
30mod tests {
31 use super::*;
32 use tga_core::config::{Config, RepositoryConfig};
33
34 #[test]
35 fn git_collector_rejects_missing_path() {
36 let cfg = RepositoryConfig {
37 path: "/definitely/does/not/exist/here".into(),
38 ..Default::default()
39 };
40 let err = git::GitCollector::new(&cfg).expect_err("should fail");
41 match err {
42 CollectError::Config(msg) => assert!(msg.contains("does not exist"), "msg: {msg}"),
43 other => panic!("unexpected error: {other:?}"),
44 }
45 }
46
47 #[test]
48 fn git_collector_rejects_non_repo_path() {
49 let cfg = RepositoryConfig {
51 path: std::env::temp_dir(),
52 ..Default::default()
53 };
54 let err = git::GitCollector::new(&cfg).expect_err("should fail");
55 assert!(matches!(err, CollectError::Git(_)));
56 }
57
58 #[test]
59 fn pipeline_constructs_with_default_config() {
60 let cfg = Config::default();
61 let _pipeline = CollectionPipeline::new(cfg);
62 }
63}