mirror of
https://github.com/joho/godotenv.git
synced 2025-10-01 23:44:01 +00:00
Make Load() without args open .env by default
This commit is contained in:
@ -30,6 +30,13 @@ func loadEnvAndCompareValues(t *testing.T, envFileName string, expectedValues ma
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadWithNoArgsLoadsDotEnv(t *testing.T) {
|
||||
err := Load()
|
||||
if err.Error() != "open .env: no such file or directory" {
|
||||
t.Errorf("Didn't try and open .env by default")
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadFileNotFound(t *testing.T) {
|
||||
err := Load("somefilethatwillneverexistever.env")
|
||||
if err == nil {
|
||||
|
Reference in New Issue
Block a user