Rustelo/tests/cli/feature_commands.rs
Jesús Pérez 7cab57b645
Some checks failed
CI/CD Pipeline / Test Suite (push) Has been cancelled
CI/CD Pipeline / Security Audit (push) Has been cancelled
CI/CD Pipeline / Build Docker Image (push) Has been cancelled
CI/CD Pipeline / Deploy to Staging (push) Has been cancelled
CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Performance Benchmarks (push) Has been cancelled
CI/CD Pipeline / Cleanup (push) Has been cancelled
chore: update layout and files
2026-02-08 20:18:46 +00:00

69 lines
1.9 KiB
Rust

//! CLI feature command tests
use anyhow::Result;
use std::process::Command;
#[test]
fn test_features_list_command() -> Result<()> {
let temp_project = crate::create_test_project()?;
let project_root = temp_project.path();
// Create mock registry
crate::helpers::create_mock_registry(project_root)?;
// Test CLI command (this would require building the CLI)
// For integration tests, we'd run the actual binary
// let output = Command::new("cargo")
// .args(["run", "--bin", "cargo-rustelo", "--", "features", "list"])
// .current_dir(project_root)
// .output()?;
// assert!(output.status.success());
// assert!(String::from_utf8_lossy(&output.stdout).contains("test-analytics"));
Ok(())
}
#[test]
fn test_feature_add_command() -> Result<()> {
let temp_project = crate::create_test_project()?;
let project_root = temp_project.path();
// Create test feature
let test_feature = crate::helpers::TestFeatureBuilder::new("test-feature")
.with_dependency("serde")
.with_env_var("TEST_VAR", "default", false);
test_feature.create_in_project(project_root)?;
// Test feature add command
// This would run: cargo rustelo features add test-feature
Ok(())
}
#[test]
fn test_feature_remove_command() -> Result<()> {
let temp_project = crate::create_test_project()?;
let project_root = temp_project.path();
// First add a feature
let test_feature = crate::helpers::TestFeatureBuilder::new("removable");
test_feature.create_in_project(project_root)?;
// Then test removal
// This would run: cargo rustelo features remove removable
Ok(())
}
#[test]
fn test_feature_status_command() -> Result<()> {
let temp_project = crate::create_test_project()?;
let project_root = temp_project.path();
// Test status command
// This would run: cargo rustelo features status
Ok(())
}