func TestCreateTestDatabaseWorksWithValidEntry(t *testing.T) { db, err := database.CreateTestDatabase("", nil, nil) assert.Nil(t, err) assert.NotNil(t, db) err = db.Close() assert.Nil(t, err) }
func TestCreateTestDatabaseFailsWithMissingFixtureFile(t *testing.T) { badFixtures := []string{"/badfilename"} db, err := database.CreateTestDatabase("", nil, badFixtures) assert.EqualError(t, err, "Error loading file /badfilename: open /badfilename: no such file or directory") assert.Nil(t, db) }
func TestCreateTestDatabaseFailsWithBadValues(t *testing.T) { db, err := database.CreateTestDatabase("!_@£@$@!±/\\", nil, nil) assert.Error(t, err) assert.Nil(t, db) }