//! Rustelo Feature Architecture Testing Suite
//! Comprehensive tests for feature management, integration, and CLI

mod integration {
    mod feature_installation;
    mod dependency_resolution;
    mod config_merging;
    mod resource_integration;
}

mod cli {
    mod feature_commands;
    mod integration_commands;
    mod error_handling;
}

mod features {
    mod analytics;
    mod smart_build;
    mod interaction_tests;
}

mod helpers;

use std::path::PathBuf;
use tempfile::TempDir;

/// Create a temporary test project with basic structure
pub fn create_test_project() -> anyhow::Result<TempDir> {
    let temp_dir = TempDir::new()?;
    let project_root = temp_dir.path();

    // Create basic project structure
    std::fs::create_dir_all(project_root.join("features"))?;
    std::fs::create_dir_all(project_root.join("registry"))?;
    std::fs::create_dir_all(project_root.join("foundation/crates"))?;
    std::fs::create_dir_all(project_root.join("framework/crates"))?;

    // Create minimal Cargo.toml
    let cargo_toml = r#"
[workspace]
resolver = "2"
members = []

[workspace.dependencies]
"#;
    std::fs::write(project_root.join("Cargo.toml"), cargo_toml)?;

    // Create minimal .env
    let env_content = "# Test project environment\n";
    std::fs::write(project_root.join(".env"), env_content)?;

    Ok(temp_dir)
}
