Skip to content

Instantly share code, notes, and snippets.

@maksadbek
Created December 30, 2014 09:33
Show Gist options
  • Save maksadbek/bad2dbc1a67d92ce5c80 to your computer and use it in GitHub Desktop.
Save maksadbek/bad2dbc1a67d92ce5c80 to your computer and use it in GitHub Desktop.
package datastore
import (
"fmt"
"github.com/mmirolim/hack-project/conf"
ds "github.com/mmirolim/hack-project/datastore"
"log"
"strings"
"testing"
)
func TestInitialize(t *testing.T) {
mockConf := `
[ds]
[ds.sqlite]
name = "sqlite3"
file = "../foo.db"
[srv]
port = "3000"
`
f := strings.NewReader(mockConf)
var App conf.App
App, err := conf.Read(f)
if err != nil {
log.Println(err)
t.Error(err)
}
fmt.Printf("%+v", App.DS)
err = ds.Initialize(App.DS)
if err != nil {
log.Println(err)
t.Error(err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment