Files
Notes/notes-service/vendor/dotenvy/tests/test-child-dir.rs
T
2026-08-01 16:11:49 +03:00

23 lines
421 B
Rust

mod common;
use dotenvy::*;
use std::{env, error::Error, fs, result::Result};
use crate::common::*;
#[test]
fn test_child_dir() -> Result<(), Box<dyn Error>> {
let dir = make_test_dotenv()?;
fs::create_dir("child")?;
env::set_current_dir("child")?;
dotenv()?;
assert_eq!(env::var("TESTKEY")?, "test_val");
env::set_current_dir(dir.path().parent().unwrap())?;
dir.close()?;
Ok(())
}