dbconf: simple preliminary test

pull/2/head
Liam Staskawicz 2013-03-30 16:58:28 -07:00
parent 634c127941
commit b41a586b5f
1 changed files with 23 additions and 0 deletions

23
dbconf_test.go Normal file
View File

@ -0,0 +1,23 @@
package main
import (
// "fmt"
"testing"
)
func TestBasics(t *testing.T) {
dbconf, err := makeDBConfDetails("db-sample", "test")
if err != nil {
t.Error("couldn't create DBConf")
}
got := []string{dbconf.MigrationsDir, dbconf.Env, dbconf.Driver, dbconf.OpenStr}
want := []string{"db-sample/migrations", "test", "postgres", "user=liam dbname=tester sslmode=disable"}
for i, s := range got {
if s != want[i] {
t.Errorf("Unexpected DBConf value. got %v, want %v", s, want[i])
}
}
}