guardy 0.2.4

Fast, secure git hooks in Rust with secret scanning and protected file synchronization
Documentation
//! Integration tests for the scan module

mod data;
mod filters;
mod pipeline;
mod reports;
mod static_data;
mod tracking;

// Core scanner tests
#[cfg(test)]
mod tests {
    use std::fs;

    use guardy::scan::Scanner;
    use tempfile::TempDir;

    #[test]
    fn test_scanner_creation() {
        let scanner = Scanner::new();
        assert!(scanner.is_ok());
    }

    #[test]
    fn test_scan_current_directory() {
        let scanner = Scanner::new().unwrap();

        // Create a temporary directory with test files
        let temp_dir = TempDir::new().unwrap();

        // Create some test files
        fs::write(temp_dir.path().join("test.txt"), "Some test content").unwrap();
        fs::write(temp_dir.path().join("test.rs"), "fn main() {}").unwrap();
        fs::write(temp_dir.path().join("test.py"), "print('hello')").unwrap();

        // Scan the temporary directory
        let result = scanner.scan(&[temp_dir.path().to_path_buf()]);
        assert!(result.is_ok());

        let scan_stats = result.unwrap();
        // We should have scanned at least one file
        assert!(
            scan_stats.files_scanned > 0,
            "Expected to scan at least 1 file, but scanned {}",
            scan_stats.files_scanned
        );
    }
}