Skip to content

Commit

Permalink
Test from_filename* return value
Browse files Browse the repository at this point in the history
  • Loading branch information
sonro committed Jul 24, 2024
1 parent 992e111 commit d6a9d82
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dotenv/tests/integration/api/from_filename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ fn empty_custom_file() {
});
}

#[test]
fn return_path_valid() {
let testenv = TestEnv::default();
test_in_env(&testenv, || {
let actual = from_filename(".env").unwrap();
assert_default_envfile_path(&testenv, &actual);
});
}

#[test]
fn default_file_not_read_on_missing_file() {
test_in_default_env(|| {
Expand Down
9 changes: 9 additions & 0 deletions dotenv/tests/integration/api/from_filename_override.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ fn empty_custom_file() {
});
}

#[test]
fn return_path_valid() {
let testenv = TestEnv::default();
test_in_env(&testenv, || {
let actual = from_filename_override(".env").unwrap();
assert_default_envfile_path(&testenv, &actual);
});
}

#[test]
fn one_var_custom_file() {
let mut testenv = TestEnv::init();
Expand Down

0 comments on commit d6a9d82

Please sign in to comment.