Created
December 30, 2014 09:33
-
-
Save maksadbek/bad2dbc1a67d92ce5c80 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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