First failing tests extracted from dotenv

This commit is contained in:
John Barton (joho)
2013-07-30 11:46:52 +10:00
parent ccd8bf5602
commit 78ba83b776
5 changed files with 50 additions and 0 deletions

30
godotenv_test.go Normal file
View File

@ -0,0 +1,30 @@
package godotenv
import (
"os"
"testing"
)
func TestLoadPlainEnv(t *testing.T) {
envFileName := "fixtures/plain.env"
err := Load(envFileName)
if err != nil {
t.Fatalf("Error loading %v", envFileName)
}
plainValues := map[string]string{
"OPTION_A": "1",
"OPTION_B": "2",
"OPTION_C": "3",
"OPTION_D": "4",
"OPTION_E": "5",
}
for k := range plainValues {
envValue := os.Getenv(k)
v := plainValues[k]
if envValue != v {
t.Errorf("Mismatch for key '%v': expected '%v' got '%v'", k, v, envValue)
}
}
}