Skip to main content

create_production_config_service_with_empty_env

Macro create_production_config_service_with_empty_env 

Source
macro_rules! create_production_config_service_with_empty_env {
    ($service_name:ident) => { ... };
}
Expand description

All twelve #[macro_export] configuration test macros, re-exported from the subx-core crate.

#[macro_export] places a macro at its defining crate’s root, so pub use subx_core::config; above cannot reach them; they are listed individually. Legacy re-exports for consumers that have not yet migrated to subx_core:: paths, and will be removed once they have. Create a ProductionConfigService with empty environment variables for testing.

This macro creates a ProductionConfigService without any environment variables, used for testing default behavior.

§Arguments

  • $service_name - Service variable name

§Examples

use subx_core::create_production_config_service_with_empty_env;

fn my_test() {
    create_production_config_service_with_empty_env!(service);

    let config = service.get_config().unwrap();
    assert_eq!(config.ai.api_key, None); // Expected no API key
}