test_with_config

Macro test_with_config 

Source
macro_rules! test_with_config {
    ($config_builder:expr, $test:expr) => { ... };
}
Expand description

Run a test with a custom configuration builder.

This macro takes a configuration builder and a test closure, creates a configuration service, and runs the test with it.

ยงExamples

use subx_cli::{test_with_config, config::{TestConfigBuilder, ConfigService}};

test_with_config!(
    TestConfigBuilder::new().with_ai_provider("openai"),
    |config_service: &dyn ConfigService| {
        let config = config_service.get_config().unwrap();
        assert_eq!(config.ai.provider, "openai");
    }
);