organizational-intelligence-plugin 0.3.4

Organizational Intelligence Plugin - Defect pattern analysis for GitHub organizations
Documentation
// Unit tests for GitHub Miner
// Following EXTREME TDD: Tests first, implementation second

use organizational_intelligence_plugin::github::GitHubMiner;

#[test]
fn test_github_miner_can_be_created() {
    // RED: This will fail until we implement GitHubMiner
    let _miner = GitHubMiner::new(None);
    // Should create successfully without token (public repos only)
}

#[test]
fn test_github_miner_with_token() {
    // Test creation with authentication token
    let token = Some("test_token".to_string());
    let _miner = GitHubMiner::new(token);
    // Should create successfully with token
}

#[tokio::test]
async fn test_fetch_organization_repos_validates_org_name() {
    // Test that empty org name is rejected
    let miner = GitHubMiner::new(None);
    let result = miner.fetch_organization_repos("").await;

    assert!(result.is_err(), "Empty org name should fail validation");
}

#[tokio::test]
async fn test_fetch_organization_repos_returns_repo_list() {
    // RED: This will fail until we implement the fetch logic
    // Note: This is a unit test, so we'll need to mock the API response
    // For now, just test the structure exists
    let miner = GitHubMiner::new(None);
    let result = miner.fetch_organization_repos("test-org").await;

    // Structure should compile even if implementation returns error
    match result {
        Ok(_repos) => {
            // Success path exists
        }
        Err(_) => {
            // Error path exists (expected for now)
        }
    }
}