Make Load() without args open .env by default

This commit is contained in:
John Barton (joho)
2013-07-31 13:51:59 +10:00
parent ac58adf673
commit 9d9f6ccb57
2 changed files with 11 additions and 0 deletions

View File

@ -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 {