0.5.1-pre.004
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: ks-config/src/environment.rs
|
||||
// version: 4
|
||||
// version: 5
|
||||
|
||||
//! Environment-file loading and configuration placeholder resolution.
|
||||
|
||||
@@ -17,7 +17,7 @@ pub struct EnvironmentLoadReport {
|
||||
pub fn load_workspace_environment(
|
||||
workspace_root: &std::path::Path,
|
||||
) -> ks_core::Result<EnvironmentLoadReport> {
|
||||
let explicit_path = std::env::var("KB_ENV_FILE").ok();
|
||||
let explicit_path = std::env::var("KS_ENV_FILE").ok();
|
||||
let selected_path = match explicit_path {
|
||||
std::option::Option::Some(path) if !path.trim().is_empty() => {
|
||||
let candidate = std::path::PathBuf::from(path);
|
||||
@@ -82,14 +82,14 @@ mod tests {
|
||||
#[test]
|
||||
fn fallback_is_used_when_variable_is_absent() {
|
||||
let resolved =
|
||||
super::resolve_environment_placeholders("${KB_CONFIG_TEST_MISSING:-fallback}");
|
||||
super::resolve_environment_placeholders("${KS_CONFIG_TEST_MISSING:-fallback}");
|
||||
assert_eq!(resolved, "fallback");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unresolved_required_placeholder_is_preserved() {
|
||||
let resolved =
|
||||
super::resolve_environment_placeholders("prefix-${KB_CONFIG_TEST_MISSING}-suffix");
|
||||
assert_eq!(resolved, "prefix-${KB_CONFIG_TEST_MISSING}-suffix");
|
||||
super::resolve_environment_placeholders("prefix-${KS_CONFIG_TEST_MISSING}-suffix");
|
||||
assert_eq!(resolved, "prefix-${KS_CONFIG_TEST_MISSING}-suffix");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user